bluesky_queueserver_api.zmq.REManagerAPI.environment_update

REManagerAPI.environment_update(*, run_in_background=None, lock_key=None)

Update RE Worker environment cache. Updates the state and cached parameters of the worker environment based on contents of the worker namespace. The updated parameters include the reference to the Run Engine and lists of existing and available plans and devices. The API is intended for using in cases when users bypass RE Manager to modify contents of the namespace, for example by connecting directly to IPython kernel (IPython mode) and executing commands via Jupyter Console. Use returned task_uid to monitor execution of the update task and check the update results.

Parameters:
run_in_background: boolean (optional, default False)

Set this parameter True to execute the update in the background thread (while a plan or another foreground task is running). Generally, it is recommended to run the update in the main thread. Developers of data acquisition workflows and/or user specific code are responsible for thread safety.

lock_key: str or None (optional)

The lock key enables access to the API when RE Manager environment 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.

  • task_uid: UID of the task that runs the update.

Raises:
RequestTimeoutError, RequestFailedError, HTTPRequestError, HTTPClientError, HTTPServerError

All exceptions raised by send_request API.

Examples

# Synchronous code (0MQ, HTTP)
RM.environment_update()

# Asynchronous code (0MQ, HTTP)
await RM.environment_update()