I have the following function:
class BulkRemoteiTunesUpdater():
def __init__(self):
...
def run_update(self, update_dict):
# do something
I want to parallelize this process. So far I have:
if __name__ == '__main__':
b=BulkRemoteiTunesUpdater()
b.fetch_updates_to_do_info()
fetched_update_info = b.fetched_update_info
pool = Pool(NUM_IN_PARALLEL)
pool.map(b.run_update, fetched_update_info)
pool.join()
What I have above raises the following error:
PicklingError: Can't pickle <type 'instancemethod'>:
attribute lookup __builtin__.instancemethod failed
What am I doing wrong here? And how would I correctly parallelize this?