Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
NewClient returns the submitting half of the worker: it enqueues payloads for a server elsewhere to run, and never executes a handler itself.
func NewServer ¶
func NewServer(redisURI string, opts ...ServerOption) worker.Server
NewServer builds a worker server backed by asynq. Tasks and cron jobs are registered on the returned server; nothing runs until Start.
func Unique ¶ added in v0.17.2
func Unique() worker.CronjobOption
Unique configures a cron job to prevent concurrent processing. When enabled, the job will not be enqueued or executed again until it completes or the timeout specified in `SHELLHUB_ASYNQ_UNIQUENESS_TIMEOUT` is reached.
Types ¶
type ServerOption ¶
type ServerOption func(s *server) error
ServerOption configures the worker server during NewServer. An option that returns an error aborts construction.
func UniquenessTimeout ¶ added in v0.17.2
func UniquenessTimeout(timeout int) ServerOption
UniquenessTimeout defines the maximum duration, in hours, for which a unique job remains locked in the queue. If the job does not complete within this timeout, the lock is released, allowing a new instance of the job to be enqueued and executed.