Await Workers

Waits for workers to either reach the running status, or to complete and exit.

Syntax
await_workers(ids, wait_for_completion=True, timeout_seconds=60)
Parameters
  • ids: int or list of worker descriptions, optional The id's of the worker engines to stop or the worker's description dicts as returned by launch_workers or list_workers. If not provided, all workers in the cluster will be stopped.
  • wait_for_completion: boolean, optional If True, will wait for all workers to exit successfully. If False, will wait for all workers to reach the running status. Defaults to True.
  • timeout_seconds: int, optional Maximum number of seconds to wait for workers to reach the desired status. Defaults to 60. If equal to 0, there is no timeout. Workers that have not reached the desired status by the timeout will be returned in the failures key. See the return value documentation.
Returns
  • dict - A dict with keys workers and failures. The workers key contains a list of dicts describing the workers that reached the desired status. The failures key contains a list of descriptions of the workers that did not.