| | |
| | | |
| | | @classmethod |
| | | def init(cls, trade_action_callback: TradeActionCallback, |
| | | queue_strategy_trade_read_for_trade: multiprocessing.Queue): |
| | | queue_strategy_trade_read_for_trade: multiprocessing.Queue, |
| | | queue_strategy_w_trade_for_query: multiprocessing.Queue |
| | | ): |
| | | cls.action_callback = trade_action_callback |
| | | cls.queue_strategy_w_trade_r = queue_strategy_trade_read_for_trade |
| | | cls.queue_strategy_w_trade_r_for_query = queue_strategy_w_trade_for_query |
| | | |
| | | @classmethod |
| | | def process_command(cls, _type, client_id, result_json, sk=None): |
| | |
| | | async_log_util.exception(logger_local_huaxin_trade_debug, e) |
| | | |
| | | # 维护连接数的稳定 |
| | | def run(self, blocking=True): |
| | | if blocking: |
| | | self.run_process_command(self.queue_strategy_w_trade_r) |
| | | else: |
| | | # 接受命令 |
| | | t1 = threading.Thread(target=lambda: self.run_process_command(self.queue_strategy_w_trade_r), daemon=True) |
| | | t1.start() |
| | | def run(self): |
| | | # 接受命令 |
| | | t1 = threading.Thread(target=lambda: self.run_process_command(self.queue_strategy_w_trade_r), daemon=True) |
| | | t1.start() |
| | | |
| | | t1 = threading.Thread(target=lambda: self.run_process_command(self.queue_strategy_w_trade_r_for_query), |
| | | daemon=True) |
| | | t1.start() |
| | | |
| | | |
| | | # L2指令管理 |