Get the latest tech news

Asyncio: A library with too many sharp corners


An explanation of some major issues with asyncio.

This is a problem with both implementations and channels don't (yet) fix this; but there's nothing in the conceptual model that would prevent some form of RetryingChannel class that blocks the producer until an item is eventually processed. Compare this to Trio's open_signal_receiver API which lets you listen to multiple signals with one object, uses an asynchronous context manager to ensure that the handler is cleaned up, and is an iterator instead of a callback so the control flow is linear and easier to follow. It is constantly full of sharp edges everywhere with implementation details leaking and poorly designed APIs forcing end users into odd code patterns to avoid fundamental flaws in the interfaces.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of library

library

Photo of asyncio

asyncio

Photo of sharp corners

sharp corners

Related news:

News photo

Sparse Matrix Library with Compressed Row Storage

News photo

Never write your own date parsing library

News photo

A conceptual overview of asyncio