which async framework?

Marko Rauhamaa marko at pacujo.net
Tue Mar 11 18:28:42 EDT 2014


Antoine Pitrou <solipsis at pitrou.net>:

> This is the usual assumption that high-level libraries are made of
> useless cruft piled up by careless programmers. But there are actual
> reasons why these frameworks have a significant amount of code, and
> people who decide to ignore those reasons are simply bound to
> reimplement non-trivial parts of those frameworks in less careful and
> less tested ways (and they have to maintain it themselves afterwards).

Maybe, maybe not. You can't assume it one way or another.

> What irks me with your response is that you phrased it as though writing
> a good event loop was an almost trivial thing to do,

It's not rocket science. There are pitfalls, to be sure, but the
resulting, solid event loop is not many lines of code. Have had to
implement it numerous times.

That said, asyncio seems to have the necessary facilities in place.
Definitely worth a closer look.

> I would personally distrust a programmer who chooses to reimplement
> their own event loop, except if they happen to have a very brilliant
> track record.

As with all programming, you have to do it right.

If you can't write your own event loop, you probably can't be trusted
with any multithreaded code, which has much more baffling corner cases.


Marko



More information about the Python-list mailing list