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()
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()