Work queues
18 commands. Toolkit id ooa.workload.
| Command | What it does |
|---|---|
| Add work item | Add 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 table | Add one item per table row (columns become fields), optionally with a reference column and tags. |
| Copy work items | Copy 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 item | Put an item aside until a date and time (UTC), e.g. when a supplier system is closed. |
| Delete work items | Delete 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 item | Take items one by one until the queue is empty; mark each completed or failed inside the loop. |
| Get next item | Take 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 counts | Count items by status. |
| Get work item | Read one work item's fields, status, attempts, result, reference, tags and error kind. |
| List items | List items, optionally only one status or only items with every tag given, as a table. |
| Mark completed | Mark an item completed, optionally storing result fields. |
| Mark failed | Record 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 items | Move 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 items | True when the queue has items waiting (new, or deferred and due). |
| Remove tags from work item | Remove tags from a work item (ignoring case). |
| Tag work item | Add tags to a work item (tags it has already are kept). |
| Unlock work item | Release an item stuck in progress (its agent stopped without marking it): it becomes new again and keeps its attempts. |
| Update work item | Change the fields of a work item and optionally send it back for processing or put it on hold (until a time or indefinitely). |