| | |
| | | import multiprocessing |
| | | import threading |
| | | import time |
| | | |
| | | from huaxin_client import l2_data_manager |
| | | from log_module import async_log_util |
| | | from log_module.log import logger_debug |
| | | |
| | | |
| | | def read(pipe): |
| | | while True: |
| | | val = pipe.recv() |
| | | if val: |
| | | print("read:", val) |
| | | |
| | | |
| | | def write(pipe): |
| | | while True: |
| | | pipe.send("test") |
| | | time.sleep(1) |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | l2_data_manager.upload_data("000798", "trading_order_canceled", 30997688, new_sk=True) |
| | | p1, p2 = multiprocessing.Pipe() |
| | | threading.Thread(target=lambda: write(p1), daemon=True).start() |
| | | threading.Thread(target=lambda: read(p2), daemon=True).start() |
| | | input() |