bluesky_queueserver_api.zmq.REManagerAPI.item_remove

REManagerAPI.item_remove(*, pos=None, uid=None, lock_key=None)

Remove an item from the queue. The last item in the queue is removed by default. Alternatively the position or UID of the item can be specified.

Parameters:
pos: str, int or None

Position of the item in the queue. The position may be positive or negative integer. Negative positions are counted from the back of the queue. If the position has a string value "front" or "back", then the item is removed from front and the back of the queue. If the value is None (default), then the position is not specified.

uid: str or None

UID of the item. If None (default), then the parameter are not specified.

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 by REManagerAPI.lock_key. See documentation on REMangerAPI.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 or None - new size of the queue.

  • item: dict - a dictionary of item parameters. {} 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()
RM.item_remove(pos="front")
RM.item_remove(pos=-1)

# Asynchronous code (0MQ, HTTP)
await RM.item_remove()
await RM.item_remove(pos="front")
await RM.item_remove(pos=-1)