def connect(self, store_addr = None, push_addr = None, ctrl_addr = None): c = zmq.Context() # ----------------------- if not store_addr: self.store_addr = zmq_addr(8888, transport='tcp') else: self.store_addr = store_addr self.store_socket = c.socket(zmq.PULL) self.store_socket.connect(self.store_addr) # ----------------------- if not push_addr: addr = zmq_addr(6666, transport='tcp') self.push_socket = c.socket(zmq.PUSH) self.push_socket.connect(addr) if not ctrl_addr: ctrl_addr = zmq_addr(7777, transport='tcp') # ----------------------- self.ctrl_socket = c.socket(zmq.ROUTER) self.ctrl_socket.setsockopt(zmq.IDENTITY, self.worker_id) self.ctrl_socket.connect(ctrl_addr)
def connect(self, push_addr = None, pull_addr = None, ctrl_addr = None): c = zmq.Context() # Pull tasks across manager pull_addr = zmq_addr(6666, transport='tcp') self.pull_socket = c.socket(zmq.PULL) self.pull_socket.bind(pull_addr) push_addr = zmq_addr(5555, transport='tcp') self.push_socket = c.socket(zmq.PUSH) self.push_socket.bind(push_addr) ctrl_addr = zmq_addr(7777, transport='tcp') self.ctrl_socket = c.socket(zmq.ROUTER) self.ctrl_socket.bind(ctrl_addr) store_addr = zmq_addr(8888, transport='tcp') self.store_socket = c.socket(zmq.REQ) self.store_socket.bind(store_addr)
def connect(self, push_addr=None, pull_addr=None, control_addr=None): c = zmq.Context() # Pull tasks across manager pull_addr = zmq_addr(6666, transport='tcp') self.pull_socket = c.socket(zmq.PULL) self.pull_socket.bind(pull_addr) push_addr = zmq_addr(5555, transport='tcp') self.push_socket = c.socket(zmq.PUSH) self.push_socket.bind(push_addr) ctrl_addr = zmq_addr(7777, transport='tcp') self.ctrl_socket = c.socket(zmq.ROUTER) self.ctrl_socket.bind(ctrl_addr)
def connect(self, push_addr=None, pull_addr=None, ctrl_addr=None): c = zmq.Context() if not pull_addr: addr = zmq_addr(5555, transport='tcp') self.pull_socket = c.socket(zmq.PULL) self.pull_socket.connect(addr) if not push_addr: addr = zmq_addr(6666, transport='tcp') self.push_socket = c.socket(zmq.PUSH) self.push_socket.connect(addr) if not ctrl_addr: addr = zmq_addr(7777, transport='tcp') self.ctrl_socket = c.socket(zmq.ROUTER) self.ctrl_socket.setsockopt(zmq.IDENTITY, self.worker_id) self.ctrl_socket.connect(addr)
def connect(self, push_addr = None, pull_addr = None, ctrl_addr = None): c = zmq.Context() if not pull_addr: addr = zmq_addr(5555, transport='tcp') self.pull_socket = c.socket(zmq.PULL) self.pull_socket.connect(addr) if not push_addr: addr = zmq_addr(6666, transport='tcp') self.push_socket = c.socket(zmq.PUSH) self.push_socket.connect(addr) if not ctrl_addr: addr = zmq_addr(7777, transport='tcp') self.ctrl_socket = c.socket(zmq.ROUTER) self.ctrl_socket.setsockopt(zmq.IDENTITY, self.worker_id) self.ctrl_socket.connect(addr)