MCPcopy Create free account
hub / github.com/ActiveState/code / map

Method map

recipes/Python/576519_Thread_pool_same_API/recipe-576519.py:119–127  ·  view source on GitHub ↗

A parallel equivalent of the map() builtin function. It blocks till the result is ready. This method chops the iterable into a number of chunks which it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting

(self, func, iterable, chunksize=None)

Source from the content-addressed store, hash-verified

117 return self.apply_async(func, args, kwds).get()
118
119 def map(self, func, iterable, chunksize=None):
120 """A parallel equivalent of the map() builtin function. It
121 blocks till the result is ready.
122
123 This method chops the iterable into a number of chunks which
124 it submits to the process pool as separate tasks. The
125 (approximate) size of these chunks can be specified by setting
126 chunksize to a positive integer."""
127 return self.map_async(func, iterable, chunksize).get()
128
129 def imap(self, func, iterable, chunksize=1):
130 """

Callers 9

_testFunction · 0.95
get_agreement_list_Function · 0.45
sum_Function · 0.45
get_all_bookmarksFunction · 0.45
mainFunction · 0.45
runFunction · 0.45
__init__Method · 0.45
recipe-577856.pyFile · 0.45
__init__Method · 0.45

Calls 2

map_asyncMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected