Documentation ¶
Index ¶
- Variables
- func AddClientToContext(ctx context.Context, obj *Client) context.Context
- func CurrentJob(ctx context.Context) *wire.Job
- func JobContext(ctx context.Context, obj *wire.Job) context.Context
- type Client
- func (c *Client) Close() error
- func (c *Client) Enqueue(ctx context.Context, msg proto.Message, opts ...JobOption) (*Result, error)
- func (c *Client) EnqueueChild(ctx context.Context, msg proto.Message) (*Result, error)
- func (c *Client) EnqueueHeir(ctx context.Context, msg proto.Message) (*Result, error)
- type ContextKey
- type JobOption
- type Result
- type Worker
- func (w *Worker) CallJob(ctx context.Context, job *wire.Job) error
- func (w *Worker) Close() error
- func (w *Worker) ContextFor(job *wire.Job) context.Context
- func (w *Worker) Heartbeat(ctx context.Context) error
- func (w *Worker) Periodic(ctx context.Context, duration time.Duration, ...) error
- func (w *Worker) RegisterJob(fn any) error
- func (w *Worker) RegisterJobs(fn ...any) error
- func (w *Worker) Run(ctx context.Context) error
- func (w *Worker) Use(fn ...WorkerMiddleware)
- type WorkerMiddleware
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientContextKey = &ContextKey{"client"}
View Source
var ErrJobNotRegistered = errors.New("job not registered")
View Source
var ErrNoRegisteredJobs = errors.New("no registered jobs")
View Source
var JobContextKey = &ContextKey{"job"}
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func CurrentClient ¶
func (*Client) EnqueueChild ¶
type ContextKey ¶
type ContextKey struct{ Name string }
type Worker ¶
type Worker struct { ID string // contains filtered or unexported fields }
func (*Worker) RegisterJob ¶
func (*Worker) RegisterJobs ¶
func (*Worker) Use ¶
func (w *Worker) Use(fn ...WorkerMiddleware)
Click to show internal directories.
Click to hide internal directories.