Multiprocessing List objects¶
-
class
flockmp.list.
ListAsync
¶ -
classmethod
apply
(_list, function, poolSize=5)¶ First we segmentat the orginal
List
in chunks, then theexecuteAsync()
will parallelize the function’s operations on the segmented lists.Parameters: - _list (list) – Input List
- fuction (func) – Function to be applied on the list
- poolSize (int) – Number of pools of processes
-
classmethod
Example¶
_list = list(range(2000))
res = ListAsync.apply(_list, lambda x: x ** 2 / 10)