Hacker News new | ask | show | jobs
by maxbond 1012 days ago
NB: In Python >= 3.9 the idiomatic way to do this is to_thread(), not familiar with these ASGI functions but I would guess they're a polyfill and/or predate 3.9.

https://docs.python.org/3/library/asyncio-task.html#asyncio....

1 comments

They are not polyfills. Multiple scheduling modes are provided for libraries that are not thread safe (it's a total mess and I avoid these wrappers like the plague)
I've had to weld some async and sync Python together with queues and callbacks, it's not pretty.