| | |
| | | queue_strategy_w_trade_r = queue_strategy_w_trade_r_ |
| | | queue_strategy_w_trade_r_for_read = queue_strategy_w_trade_r_for_read_ |
| | | |
| | | |
| | | t1 = threading.Thread(target=lambda: __run_recv_queue_trade(queue_strategy_r_trade_w_), daemon=True) |
| | | t1.start() |
| | | t1 = threading.Thread(target=lambda: __run_save_data(), daemon=True) |
| | |
| | | |
| | | |
| | | # 网络请求 |
| | | def __request(_type, data, request_id=None, blocking=False, is_pipe=True, log_enable=True,is_trade=False): |
| | | def __request(_type, data, request_id=None, blocking=False, is_pipe=True, log_enable=True, is_trade=False): |
| | | if not request_id: |
| | | request_id = __get_request_id(_type) |
| | | try: |
| | |
| | | "price": price, "shadow_price": shadow_price, "sinfo": sinfo, "blocking": blocking}, |
| | | request_id=request_id, |
| | | blocking=blocking, |
| | | is_pipe=is_pipe_channel_normal(),is_trade=True) |
| | | is_pipe=is_pipe_channel_normal(), is_trade=True) |
| | | try: |
| | | if blocking: |
| | | return __read_response(request_id, blocking) |
| | |
| | | "orderRef": orderRef, |
| | | "orderActionRef": order_action_ref, |
| | | "orderSysID": orderSysID, "sinfo": sinfo}, request_id=request_id, blocking=blocking, |
| | | is_pipe=is_pipe_channel_normal(),is_trade=True) |
| | | is_pipe=is_pipe_channel_normal(), is_trade=True) |
| | | try: |
| | | return __read_response(request_id, blocking) |
| | | finally: |