The point is to have something that behaves like imap_unordered method from mupltiprocessing.Pool, but accepts dicts describing functions instead of actual function objects, so we can do stuff like that:
api = API('mytaskserver.com')
function = {
"package": "my_package",
"function": "foo"
}
argskwargslist = [
[
(42, 1),
{
"bar": True,
"spam": False
}
],
[
(13, 2),
{
"bar": False,
"spam": True
}
],
]
for result in api.imap_unordered(task, argskwargslist):
print(result)
The point is to have something that behaves like
imap_unordered
method frommupltiprocessing.Pool
, but accepts dicts describing functions instead of actual function objects, so we can do stuff like that: