| | |
| | | class TradeCommandManager: |
| | | trade_client_dict = {} |
| | | _instance = None |
| | | process_command_thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=20) |
| | | process_command_thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=30) |
| | | |
| | | def __new__(cls, *args, **kwargs): |
| | | if not cls._instance: |
| | |
| | | val = pipe_strategy.recv() |
| | | if val: |
| | | val = json.loads(val) |
| | | # print("run_process_command", val) |
| | | _type = val["type"] |
| | | threading.Thread(target=lambda: cls.process_command(_type, None, val), daemon=True).start() |
| | | cls.process_command_thread_pool.submit(lambda: cls.process_command(_type, None, val)) |
| | | |
| | | except Exception as e: |
| | | logger_local_huaxin_trade_debug.exception(e) |
| | | logging.exception(e) |