bluesky_queueserver_api.zmq.REManagerAPI.environment_destroy

REManagerAPI.environment_destroy(*, lock_key=None)

Destroy RE Worker environment. This is the last-resort operation that allows to recover the Queue Server if RE Worker environment becomes unresponsive and needs to be shut down. The operation kills RE Worker process, therefore it can be executed at any time. The operation may be dangerous, since it kills any running plans or tasks. The API request only initiates the operation of destroying an environment. If the request is accepted, the manager_state status parameter is expected to change to destroying_environment and then to idle when the operation is completed. Check worker_environment_exists status flag to see if the environment was destroyed.

Parameters:
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.

Raises:
RequestTimeoutError, RequestFailedError, HTTPRequestError, HTTPClientError, HTTPServerError

All exceptions raised by send_request API.

Examples

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

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