2011-04-02 00:45:26 -07:00
|
|
|
from multiprocessing.managers import BaseManager
|
|
|
|
import Queue
|
|
|
|
|
|
|
|
tasks_q = Queue.Queue()
|
|
|
|
results_q = Queue.Queue()
|
2011-05-08 12:36:06 -07:00
|
|
|
minions_q = Queue.Queue()
|
2011-04-02 00:45:26 -07:00
|
|
|
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)
|
2011-05-08 12:36:06 -07:00
|
|
|
QueueManager.register('get_minions_q', callable=lambda:minions_q )
|
2011-04-02 00:45:26 -07:00
|
|
|
QueueManager.register('get_master_q', callable=lambda:master_q )
|
|
|
|
|
|
|
|
def get_qs(m):
|
|
|
|
"""
|
|
|
|
returns all relevant queues
|
|
|
|
"""
|
2011-05-08 12:36:06 -07:00
|
|
|
return (m.get_tasks_q(), m.get_results_q(), m.get_master_q(), m.get_minions_q())
|