Esempio n. 1
0
File: node.py Progetto: ll2088/cola
 def __init__(self, base_dir, rpc_server, addr, addrs,
              copies=1, n_priorities=3, deduper=None,
              app_name=None, logger=None):
     self.dir_ = base_dir
     self.addr_ = addr
     self.addrs = list(addrs)
     self.mq_node = LocalMessageQueueNode(
         base_dir, rpc_server, addr, addrs, 
         copies=copies, n_priorities=n_priorities, deduper=deduper,
         app_name=app_name)
     self.distributor = Distributor(addrs, copies=copies)
     self.logger = logger
     
     self.prefix = get_rpc_prefix(app_name, 'mq')
     
     self._lock = threading.Lock()
     self.inited = False
Esempio n. 2
0
 def __init__(self, addrs, app_name=None, copies=1):
     self.addrs = addrs
     self.distributors = Distributor(addrs, copies=copies)
     self.prefix = get_rpc_prefix(app_name, 'mq')