Skip to main content

Work queues

18 commands. Toolkit id ooa.workload.

CommandWhat it does
Add work itemAdd one item (a Dictionary of fields) to a queue, optionally with a reference that is unique in the queue and tags.
Add work items from tableAdd one item per table row (columns become fields), optionally with a reference column and tags.
Copy work itemsCopy items to another queue as new items (new ids, same data, reference and tags); items whose reference the other queue has already are skipped.
Defer itemPut an item aside until a date and time (UTC), e.g. when a supplier system is closed.
Delete work itemsDelete items by status, age, tags or ids. Only completed and failed items are deleted unless force is on (items in progress never are, unless forced).
Each available work itemTake items one by one until the queue is empty; mark each completed or failed inside the loop.
Get next itemTake the oldest available item (new, or deferred and due), optionally only one with every tag given, and mark it in progress; with wait_seconds it waits for an item to arrive. found is false when there is none.
Get queue countsCount items by status.
Get work itemRead one work item's fields, status, attempts, result, reference, tags and error kind.
List itemsList items, optionally only one status or only items with every tag given, as a table.
Mark completedMark an item completed, optionally storing result fields.
Mark failedRecord a failure. A system exception (the default) puts the item back for another attempt until max_attempts is reached; a business exception (the item itself is wrong) fails it at once, without retries.
Move work itemsMove items to another queue as new items (new ids, same data, reference and tags); items in progress, and items whose reference the other queue has, stay.
Queue has itemsTrue when the queue has items waiting (new, or deferred and due).
Remove tags from work itemRemove tags from a work item (ignoring case).
Tag work itemAdd tags to a work item (tags it has already are kept).
Unlock work itemRelease an item stuck in progress (its agent stopped without marking it): it becomes new again and keeps its attempts.
Update work itemChange the fields of a work item and optionally send it back for processing or put it on hold (until a time or indefinitely).