22 lines
617 B
Python
22 lines
617 B
Python
|
from multiprocessing.managers import BaseManager
|
||
|
import Queue
|
||
|
|
||
|
tasks_q = Queue.Queue()
|
||
|
results_q = Queue.Queue()
|
||
|
slaves_q = Queue.Queue()
|
||
|
master_q = Queue.Queue()
|
||
|
|
||
|
class QueueManager(BaseManager):
|
||
|
pass
|
||
|
|
||
|
QueueManager.register('get_tasks_q', callable=lambda:tasks_q )
|
||
|
QueueManager.register('get_results_q', callable=lambda:results_q)
|
||
|
QueueManager.register('get_slaves_q', callable=lambda:slaves_q )
|
||
|
QueueManager.register('get_master_q', callable=lambda:master_q )
|
||
|
|
||
|
def get_qs(m):
|
||
|
"""
|
||
|
returns all relevant queues
|
||
|
"""
|
||
|
return (m.get_tasks_q(), m.get_results_q(), m.get_master_q(), m.get_slaves_q())
|