added a server
This commit is contained in:
parent
58d651969e
commit
8b1670fdc0
16
bin/server.py
Normal file
16
bin/server.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from multiprocessing.managers import BaseManager
|
||||||
|
import Queue
|
||||||
|
|
||||||
|
inqueue = Queue.Queue()
|
||||||
|
outqueue = Queue.Queue()
|
||||||
|
class QueueManager(BaseManager):
|
||||||
|
pass
|
||||||
|
QueueManager.register('get_inqueue', callable=lambda:inqueue)
|
||||||
|
QueueManager.register('get_outqueue', callable=lambda:outqueue)
|
||||||
|
|
||||||
|
|
||||||
|
m = QueueManager(address=('', 50000), authkey='asdf')
|
||||||
|
s = m.get_server()
|
||||||
|
s.serve_forever()
|
Loading…
Reference in New Issue
Block a user