LUCIT-Systems-and-Development / unicorn-binance-rest-api

A Python SDK by LUCIT to use the Binance REST API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, us, tr) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-rest-api.docs.lucit.tech
Other
60 stars 17 forks source link

async Client API Requests #49

Closed oliver-zehentleitner closed 1 year ago

oliver-zehentleitner commented 1 year ago

Discussed in https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api/discussions/48

Originally posted by **45by90** September 17, 2022 Hello, Is there a way to make async client API calls, i.e., make a trade call and wait for it while still getting in streaming data? The websocket stream is blocked while trying to make a trade (maybe a couple of tries). By the time the trade goes through or fails, the stream rushes to catch up and everything gets screwed up. Or perhaps something I'm missing? I've tried things like: ``` with c.concurrent.futures.ThreadPoolExecutor() as executor: future = executor.submit(self._executor,'BUY',quant,trade_this_price,price_filter) trade_r = future.result() ``` But it still blocks the main process (for example, I have a window display updating, which freezes while the order executions are trying to get put through). Thank you, JJ
45by90 commented 1 year ago

Any thoughts on this?

oliver-zehentleitner commented 1 year ago

yes, we want to release an async extension. so that classic and async version will be available together.

oliver-zehentleitner commented 1 year ago

Continue here: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-rest-api/issues/15