This allows multiple clients to share futures or small bits of data between each other with a multi-producer/multi-consumer queue. All metadata is sequentialized through the scheduler.
Elements of the Queue must be either Futures or msgpack-encodable data (ints, strings, lists, dicts). All data is sent through the scheduler so it is wise not to send large objects. To share large objects scatter the data and share the future instead.
This object is experimental
Name used by other clients and the scheduler to identify the queue. If not given, a random name will be generated.
Client used for communication with the scheduler. If not given, the default global client will be used.
Number of items allowed in the queue. If 0 (the default), the queue size is unbounded.
Distributed Queue
Variable
shared variable between clients
>>> from dask.distributed import Client, Queue # doctest: +SKIPSee :
... client = Client() # doctest: +SKIP
... queue = Queue('x') # doctest: +SKIP
... future = client.submit(f, x) # doctest: +SKIP
... queue.put(future) # doctest: +SKIP
The following pages refer to to this document either explicitly or contain code examples using this.
distributed.queues.Queue
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