Custom work queues
A work queue is code that runs without human intervention as a background process on multiple servers to process the units of work for a batch in parallel. Develop a custom work queue if you require the processing of units of work in parallel to achieve an acceptable throughput rate.
About custom work queues
A custom work queues comprises the following components.
- Writer
- The findTargets method on a Gosu class that extends the
WorkQueuBaseclass that selects the units of work for a batch and writes work items for them in the work queue table. - Work queue
- An entity type that implements the
WorkItemdelegate, such as the StandardWorkItem entity, to establish the database table for the work queue and its work items. - Worker
- The processWorkItem method on the same Gosu class that
extends the
WorkQueuBasebase class that processes the units of work identified on the work queue by work items
Starting the writer initiates a run of the type of batch processing that a work queue performs. The batch is complete when the workers exhaust the queue of all work items in the batch, except those they fail to process successfully.
