Worker Pool
A Queue Connection is defined inside your cbq config file using a QueueConnectionDefinition
builder component. You can create one of these builder components using the newConnection
method.
WorkerPoolDefinition Methods
setName
Sets the name for the Worker Pool. Usually not called directly as the newWorkerPool
method requires a name
.
forConnection
Sets the name of the associated Connection for the Worker Pool. This must reference an already registered Connection.
setConnectionName
Alias for forConnection.
quantity
Sets the quantity of workers for this Worker Pool.
setQuantity
Alias for quantity.
onQueue
The name of a queue to work. The default queue is named default
.
Some Providers allow for working a priority of queues, such as the DBProvider
. In these cases, you can pass an array of queues, in priority order, using the asterisk (*
) as a wildcard character.
Throws: cbq.WorkerPool.MultipleQueuesNotSupported
setQueue
Alias for onQueue.
backoff
Sets the backoff time amount, in seconds.
setBackoff
Alias for backoff.
timeout
Sets the timeout time amount, in seconds.
setTimeout
Alias for timeout.
maxAttempts
Sets the max number of attempts.
setMaxAttempts
Alias for maxAttempts.