def __init__(self, sp_info, db_info, socket_info):
    mongo_cli = pmg.MongoClient(db_info['host'])
    admin_db = mongo_cli.get_database('admin')
    admin_db.authenticate(db_info['user'], db_info['pwd'])
    self._db = mongo_cli.get_database(db_info['db'])
    self._col = self._db.get_collection('realtime_future_1min_')
    self._col.create_index([('datetime', pmg.DESCENDING), ('code', pmg.ASCENDING)], unique=True)
    self._col.create_index([('code', pmg.ASCENDING)])
    self.ctx = zmq.Context()
    self.trigger_socket = self.ctx.socket(zmq.PUB)
    self.trigger_socket.bind(f"tcp://*: {socket_info['trigger_port']}")
    self.prod_codes = {}
    initialize()
    set_login_info(**sp_info)
    self._init_callback()
    login()
    time.sleep(3)
    self._init_subscribe()
def __init__(self, sp_info, db_info, socket_info):
    mongo_cli = pmg.MongoClient(db_info['host'])
    admin_db = mongo_cli.get_database('admin')
    admin_db.authenticate(db_info['user'], db_info['pwd'])
    self._db = mongo_cli.get_database(db_info['db'])
    self._col = self._db.get_collection('realtime_future_1min_')
    self._col.create_index([('datetime', pmg.DESCENDING), ('code', pmg.ASCENDING)], unique=True)
    self._col.create_index([('code', pmg.ASCENDING)])
    self.ctx = zmq.Context()
    self.trigger_socket = self.ctx.socket(zmq.PUB)
    self.trigger_socket.bind(f"tcp://*: {socket_info['trigger_port']}")
    self.prod_codes = {}
    initialize()
    set_login_info(**sp_info)
    self._init_callback()
    login()
    time.sleep(3)
    self._init_subscribe()