Closed leftys closed 2 hours ago
No, I have no idea.
That was the reason why I decided not to provide async iteration interface like aiohttp and websockets do.
Because both create_task
and Queue are slow and introduce significant delay and a lot of churn for the event loop.
Which is very undesirable when there is a spike in market activity.
Internally that's what aiohttp and websockets do. Internally they have same non-async on_ws_frame
or similar, and they set result for a future object. And later event loop picks it up and wakes up user coroutine.
Hi, do you have any idea how to make reading the data asynchronous? Eg. making the on_ws_frame function async? I tried
asyncio.create_task
and pushing the data intoasyncio.Queue
, but both is pretty slow.