I have a generator that I want to listify.
gen = requests.get(url, stream=True).iter_content(chunk_size=100)
I want to listify this parallely.
out = list(gen)
does it synchronously.
Running this:
from multiprocessing import Pool
out = Pool(10).imap((lambda x: x), gen)
gives error:
raise value
cPickle.PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed