blocking_wait_futures#

rojak.core.distributed_tools.blocking_wait_futures(dask_collection: object) None[source]#

Utility function to synchronise distributed execution

Parameters:

dask_collection (object) – Dask collection to wait on the futures of. If object is not a Dask collection, nothing happens.

Return type:

None

>>> blocking_wait_futures([])
>>> from distributed import Client
>>> client = Client()
>>> import dask.array as da
>>> to_persist = da.random.default_rng(5).standard_normal(10).persist()
>>> blocking_wait_futures(da.random.default_rng(5).standard_normal(10).persist())
>>> to_persist
dask.array<standard_normal, shape=(10,), dtype=float64, chunksize=(10,), chunktype=numpy.ndarray>
>>> client.close()