bluesky_queueserver_api.zmq.REManagerAPI.item_remove_batch¶
- REManagerAPI.item_remove_batch(*, uids, ignore_missing=None, lock_key=None)¶
Remove a batch of items from the queue. The batch of items is represented as a list of item UIDs.
- Parameters:
- uids: list(str)
List of UIDs of the items in the batch. The list may not contain repeated UIDs. All UIDs must be present in the queue, otherwise the operation fails unless
ignore_missing
isTrue
. The list may be empty.- ignore_missing: boolean (optional)
If the value is
False
, then the method fails if the batch contains repeating items or some of the batch items are not found in the queue. IfTrue
(default), then the method attempts to remove all items in the batch and ignores missing items. The method returns the list of items that were removed from the queue.- lock_key: str or None (optional)
The lock key enables access to the API when RE Manager queue is locked. If the parameter is not
None
, the key overrides the current lock key set byREManagerAPI.lock_key
. See documentation onREMangerAPI.lock()
for more information. Default:None
.
- Returns:
- response: dict
Dictionary keys:
success
: boolean - success of the request.msg
: str - error message in case the request is rejected by RE Manager or operation failed.qsize
: int - new size of the queue.items
: list(dict) - the list of removed items, which is[]
if the operation fails.
- Raises:
- RequestTimeoutError, RequestFailedError, HTTPRequestError, HTTPClientError, HTTPServerError
All exceptions raised by
send_request
API.
Examples
# Synchronous code (0MQ, HTTP) RM.item_remove_batch(["item-uid1", "item-uid2"]) # Asynchronous code (0MQ, HTTP) await RM.item_remove_batch(["item-uid1", "item-uid2"])