qstash

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package qstash holds the reference Queue adapter over Upstash QStash HTTP queues, talking to the REST API directly.

Index

Constants

View Source
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 New

func New(client Client, opts Options) *Queue

New makes a queue.

func (*Queue) Enqueue

func (q *Queue) Enqueue(ctx context.Context, job ports.RunJob, opts *ports.EnqueueOptions) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL