worker_client(timeout=None, separate_thread=True)
This context manager is intended to be called within functions that we run on workers. When run as a context manager it delivers a client Client
object that can submit other tasks directly from that worker.
Timeout after which to error out. Defaults to the distributed.comm.timeouts.connect
configuration value.
Whether to run this function outside of the normal thread pool defaults to True
Get client for this thread
>>> def func(x):This example is valid syntax, but we were not able to check execution
... with worker_client(timeout="10s") as c: # connect from worker back to scheduler
... a = c.submit(inc, x) # this task can submit more tasks
... b = c.submit(dec, x)
... result = c.gather([a, b]) # and gather results
... return result
>>> future = client.submit(func, 1) # submit func(1) on clusterSee :
The following pages refer to to this document either explicitly or contain code examples using this.
distributed.worker.get_client
distributed.worker.get_worker
distributed.worker_client.worker_client
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them