Documentation
¶
Overview ¶
Package qstash holds the reference Queue adapter over Upstash QStash HTTP queues, talking to the REST API directly.
Index ¶
Constants ¶
const DefaultBaseURL = "https://qstash.upstash.io"
DefaultBaseURL is the QStash API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Token is the QSTASH_TOKEN.
Token string
// BaseURL defaults to DefaultBaseURL.
BaseURL string
// HTTP defaults to http.DefaultClient.
HTTP *http.Client
}
Client is the QStash REST client the queue uses.
type Options ¶
type Options struct {
// URL is the fully-qualified consumer URL, e.g. https://app.example.com/api/queue/agent-run
URL string
// QueueName is the queue for flow control (§2.8). Defaults to agent-runs.
QueueName string
}
Options tune the queue.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a Queue over QStash.
func (*Queue) Cancel ¶ added in v0.3.0
Cancel is a no-op: QStash offers no way to withdraw a queued message by key, and every caller treats a delivered row as a correct no-op.
func (*Queue) Enqueue ¶
Enqueue dispatches a job. A delayed job goes out as a published message rather than a queued one: QStash supports delays on publish only and rejects Upstash-Delay on enqueue. The trade is that this one message skips the queue's flow control, acceptable for the two things that ask for a delay (a HITL expiry and a blocked job's redrive), since both are single messages the run lock already serializes.