homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mrts
Recipients jnoller, mark.dickinson, mrts
Date 2008年10月23日.11:17:28
SpamBayes Score 0.007807648
Marked as misclassified No
Message-id <1224760650.39.0.0071160783856.issue3518@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation should be amended as follows:
Running the following commands creates a server for a single shared
queue which remote clients can access:
>>> from multiprocessing.managers import BaseManager
>>> import Queue
>>> queue = Queue.Queue()
>>> class QueueManager(BaseManager): pass
...
>>> QueueManager.register('getQueue', callable=lambda:queue)
>>> m = QueueManager(address=('', 50000), authkey='abracadabra')
>>> s = m.get_server()
>>> s.serve_forever()
One client can access the server as follows:
>>> from multiprocessing.managers import BaseManager
>>> class QueueManager(BaseManager): pass
...
>>> QueueManager.register('getQueue')
>>> m = QueueManager(address=('localhost', 50000), authkey='abracadabra')
>>> m.connect()
>>> q = m.getQueue()
>>> q.put('hello')
Another client can also use it:
>>> from multiprocessing.managers import BaseManager
>>> class QueueManager(BaseManager): pass
...
>>> QueueManager.register('getQueue')
>>> m = QueueManager(address=('localhost', 50000), authkey='abracadabra')
>>> m.connect()
>>> q = m.getQueue()
>>> q.get()
History
Date User Action Args
2008年10月23日 11:17:30mrtssetrecipients: + mrts, mark.dickinson, jnoller
2008年10月23日 11:17:30mrtssetmessageid: <1224760650.39.0.0071160783856.issue3518@psf.upfronthosting.co.za>
2008年10月23日 11:17:29mrtslinkissue3518 messages
2008年10月23日 11:17:28mrtscreate

AltStyle によって変換されたページ (->オリジナル) /