Message260396
Hello,
My colleague and I have both written parallel executors for the concurrent_futures module, and are having an argument, as described in the dialog below. To resolve, I would like to add "order of results is undefined" to disambiguate the docs for "map(func, *iterables, timeout=None)".
DISCUSSION
Q: Correct Semantics to return results out of order?
JH: No, breaks API as stated
Rebut: order is undefined, concurrent_futures specifies map() returns an iterator, where builtin map returns a list.
Q: Does it break the spirit of the module?
A: No, I believe one of the best things about doing things async is the dataflow model: do the next thing as soon as its inputs are ready.
Q: Should we hold up the caller in all cases when there are stragglers, i.e. elements that compute slower?
A: No, the interface should allow both modes.
def james_map(exe, fn, *args):
return iter( sorted( list( exe.map( fn, *args ) ) ) ) |
|
Date |
User |
Action |
Args |
2016-02-17 12:26:30 | F.D. Sacerdoti | set | recipients:
+ F.D. Sacerdoti |
2016-02-17 12:26:30 | F.D. Sacerdoti | set | messageid: <1455711990.13.0.290959896018.issue26374@psf.upfronthosting.co.za> |
2016-02-17 12:26:30 | F.D. Sacerdoti | link | issue26374 messages |
2016-02-17 12:26:28 | F.D. Sacerdoti | create | |
|