Documentation
¶
Overview ¶
Package asynq provides various asynq utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogger ¶
GetLogger returns the slog.Logger instance from the provided context, if found, or slog.DefaultLogger otherwise.
func NewDefaultErrorHandler ¶
func NewDefaultErrorHandler() asynq.ErrorHandlerFunc
NewDefaultErrorHandler returns an asynq.ErrorHandlerFunc, which logs the task and the reason why it has failed.
func NewLoggerMiddleware ¶
func NewLoggerMiddleware(logger *slog.Logger) asynq.MiddlewareFunc
NewLoggerMiddleware returns a new asynq.MiddlewareFunc, which embeds a slog.Logger in the context provided to task handlers.
func NewMeasuringMiddleware ¶
func NewMeasuringMiddleware() asynq.MiddlewareFunc
NewMeasuringMiddleware returns a new asynq.MiddlewareFunc which measures the execution of tasks.
func SkipRetry ¶
SkipRetry wraps the provided error with asynq.SkipRetry in order to signal asynq that the task should not retried.
func Unmarshal ¶
Unmarshal unmarshals the given payload data by first attempting to unmarshal using json.Unmarshal, and if not successful then falls back to yaml.Unmarshal.
Types ¶
This section is empty.