| | |
| | | import time |
| | | import concurrent.futures |
| | | |
| | | import requests |
| | | |
| | | from utils import socket_util, tool |
| | | |
| | | __response_thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=15) |
| | |
| | | return |
| | | # 设置响应内容 |
| | | set_response(data_json["request_id"], data_json['data']) |
| | | |
| | | def __send_to_trade_server(data_str): |
| | | requests.post("http://183.234.94.164:12881/trade_callback", data_str) |
| | | |
| | | if queue is not None: |
| | | while True: |
| | |
| | | try: |
| | | # 交易回调 |
| | | data_json = data_json["data"] |
| | | ctype = data_json["type"] |
| | | # 将交易回调传递给交易服务器 |
| | | __response_thread_pool.submit(__send_to_trade_server, val) |
| | | # 记录交易反馈日志 |
| | | finally: |
| | | pass |
| | |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | pass |
| | | requests.post("http://192.168.3.241:12881/trade_callback", json.dumps({"code":"123123"})) |