distributed 2021.10.0

ParametersReturnsBackRef
gather(self, futures, errors='raise', direct=None, asynchronous=None)

Accepts a future, nested container of futures, iterator, or queue. The return type will match the input type.

Parameters

futures : Collection of futures

This can be a possibly nested collection of Future objects. Collections can be lists, sets, or dictionaries

errors : string

Either 'raise' or 'skip' if we should raise if a future has erred or skip its inclusion in the output collection

direct : boolean

Whether or not to connect directly to the workers, or to ask the scheduler to serve as intermediary. This can also be set when creating the Client.

Returns

results: a collection of the same type as the input, but now with
gathered results rather than futures

Gather futures from distributed memory

See Also

Client.scatter

Send data out to cluster

Examples

This example is valid syntax, but we were not able to check execution
>>> from operator import add  # doctest: +SKIP
... c = Client('127.0.0.1:8787') # doctest: +SKIP
... x = c.submit(add, 1, 2) # doctest: +SKIP
... c.gather(x) # doctest: +SKIP 3
This example is valid syntax, but we were not able to check execution
>>> c.gather([x, [x], x])  # support lists and dicts # doctest: +SKIP
[3, [3], 3]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

distributed.client.Client.gather distributed.client.Client distributed.client.Client.scatter distributed.worker.get_client

Local connectivity graph

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


File: /distributed/client.py#1918
type: <class 'function'>
Commit: