question about multiprocessing

H

hywhy

first sorry for my poor english. Is there any problem in the follow code?
thanks!


from multiprocessing.managers import BaseManager
import Queue

class CrawlerManager(BaseManager):
pass

downloader_queue = Queue.Queue()

downloader_queue.put('hello')

CrawlerManager.register('get_downloader_queue', callable=lambda:
downloader_queue)

mgr = CrawlerManager()
mgr.start()

q = mgr.get_downloader_queue()



error:

pickle.PicklingError: Can't pickle <function <lambda> at 0x00C02F70>: it's
not found as __parents_main__.<lambda>
Traceback (most recent call last):

print q.get()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top