Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Enqueuer ¶
type Enqueuer struct {
// contains filtered or unexported fields
}
func NewEnqueuer ¶
NewEnqueuer creates a new enqueuer.
URL is a string connection in the AMQP URI format.
func (*Enqueuer) Enqueue ¶
Enqueue will enqueue the specified message for job queue.
type JobInfo ¶
type JobType ¶
type JobType struct { Name string // The queue name Handle JobHandle // The job handler function Priority uint // Priority from 1 to 10000 Retry uint8 // Retry count 1 to 255 }
JobType settings of job which should be passed to RegisterJob
type Middleware ¶
type Middleware func(context.Context, NextMiddleware) error
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(url string, concurrency uint, middlewares ...Middleware) *Pool
NewWorkerPool creates a new worker pool.
URL is a string connection in the AMQP URI format.
Concurrency specifies how many workers to spin up - each worker can process jobs concurrently.
func (*Pool) RegisterJob ¶
RegisterJob adds a job with handler for 'name' queue and allows you to specify options such as a job's priority and it's retry count.
Click to show internal directories.
Click to hide internal directories.