forgot to add this file which abstracts away the binding of methods to the network queue
This commit is contained in:
parent
5854fb4990
commit
0a0e43f409
21
interp/cluster/__init__.py
Normal file
21
interp/cluster/__init__.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
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())
|
Loading…
Reference in New Issue
Block a user