Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundWorker ¶
type BackgroundWorker struct { context.Context sync.RWMutex // contains filtered or unexported fields }
BackgroundWorker is a worker that runs tasks on background
func (*BackgroundWorker) Enqueue ¶
func (w *BackgroundWorker) Enqueue(task Task)
Enqueue a task on current worker
func (*BackgroundWorker) Length ¶
func (w *BackgroundWorker) Length() int64
Length from current queue length
func (*BackgroundWorker) Run ¶
func (w *BackgroundWorker) Run(workerID string)
Run initializes the worker loop
func (*BackgroundWorker) Shutdown ¶ added in v0.13.0
func (w *BackgroundWorker) Shutdown(ctx context.Context) error
Shutdown current worker
func (*BackgroundWorker) Use ¶
func (w *BackgroundWorker) Use(middleware MiddlewareFunc)
Use this to inject worker dependencies
type Context ¶
Context holds references to services available for jobs
func NewContext ¶
NewContext creates a new context
Click to show internal directories.
Click to hide internal directories.