9 from Connection
import Connection
10 import Consts
as consts
16 logger = logging.getLogger(APP_CONSTS.LOGGER_NAME)
23 Factory is used to create various connection objects 48 def build(self, connect_type, connect_params, endPointType=consts.CLIENT_CONNECT):
49 sock = self.
builders[connect_type](connect_params, endPointType)
73 addr =
"tcp://" + connect_params.host +
":" + str(connect_params.port)
74 if endPointType == consts.CLIENT_CONNECT:
76 sock.setsockopt(zmq.IDENTITY, self.
id_generator.get_connection_uid())
79 if endPointType == consts.SERVER_CONNECT:
def build(self, connect_type, connect_params, endPointType=consts.CLIENT_CONNECT)
build a connection
def __init__(self, id_generator)
constructor
def __admin_connection(self, connect_params, endPointType)
helper function
The builder is used to encapsulation routine of creation various type of connections.
def __data_connection(self, connect_params, endPointType)
helper function