3 ms·
I would say that there are maybe three different ways of async rather than two. Broadly: - wholly implicitly (by monkeypatching stuff with gevent typically)
by calpaterson 6y ago
I would say that there are maybe three different ways of async rather than two. Broadly:
- wholly implicitly (by monkeypatching stuff with gevent typically)
- async/await
- by reactor (twisted)
async/await is not really an alternative to the explicit style of twisted. To paraphase Guy Steele it is an attempt to drag the monkeypatchers halfway to twisted. It doesn't really solve the problem of mixing sync code in with your async code, the only preventative to that is programmer diligence. If you read from a file using open in the middle of your async code you're going to block the process while bytes are gathered for you. However it does prevent you from accidentally using async code in the middle of your sync code.
Problems like backpressure and failure handling are largely unsolved in asyncio.