| | |
| | | for i in range(constant.HUAXIN_L2_MAX_CODES_COUNT): |
| | | order_ipc_hosts.append(f"ipc://l2order{i}.ipc") |
| | | |
| | | # 此处将L2的进程与策略进程合并 |
| | | # L2 |
| | | l2Process = multiprocessing.Process( |
| | | target=huaxin_client.l2_client.run, |
| | | args=(queue_other_w_l2_r, order_queues, transaction_queues, market_queue, order_ipc_hosts)) |
| | | l2Process.start() |
| | | # l2Process = multiprocessing.Process( |
| | | # target=huaxin_client.l2_client.run, |
| | | # args=(queue_other_w_l2_r, order_queues, transaction_queues, market_queue, order_ipc_hosts,huaxin_trade_server.my_l2_data_callback)) |
| | | # l2Process.start() |
| | | # 将L2的进程改为进程执行 |
| | | threading.Thread(target=huaxin_client.l2_client.run, args=( |
| | | queue_other_w_l2_r, order_queues, transaction_queues, market_queue, order_ipc_hosts, |
| | | huaxin_trade_server.my_l2_data_callbacks), daemon=True).start() |
| | | |
| | | # 主进程 |
| | | createTradeServer(pss_strategy, queue_strategy_r_trade_w, queue_l1_w_strategy_r, queue_strategy_w_trade_r, |
| | |
| | | |
| | | # 将tradeServer作为主进程 |
| | | l1Process.join() |
| | | l2Process.join() |
| | | # l2Process.join() |
| | | tradeProcess.join() |
| | | except Exception as e: |
| | | logging.exception(e) |