Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option is a function, which configures the Worker.
func WithErrorHandler ¶
func WithErrorHandler(handler asynq.ErrorHandler) Option
WithErrorHandler is an Option, which configures the Worker to use the specified asynq.ErrorHandler.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker wraps an asynq.Server and asynq.ServeMux with additional convenience methods for task handlers.
func NewFromConfig ¶
func NewFromConfig(r asynq.RedisClientOpt, conf config.WorkerConfig, opts ...Option) *Worker
NewFromConfig creates a new Worker based on the provided config.WorkerConfig spec.
func (*Worker) HandlersFromRegistry ¶
HandlersFromRegistry registers task handlers with the Worker multiplexer using the given registry.
func (*Worker) Run ¶
Run starts the task processing by calling asynq.Server.Start and blocks until an OS signal is received.
func (*Worker) Shutdown ¶
func (w *Worker) Shutdown()
Shutdown gracefully shuts down the server by calling asynq.Server.Shutdown.
func (*Worker) UseMiddlewares ¶
func (w *Worker) UseMiddlewares(middlewares ...asynq.MiddlewareFunc)
UseMiddlewares configures the Worker multiplexer to use the specified asynq.MiddlewareFunc.