theelous3 / asks

Async requests-like httplib for python.
MIT License
508 stars 63 forks source link

Upgraded to AnyIO v2.0 #172

Closed agronholm closed 4 years ago

agronholm commented 4 years ago

The code was updated to work with AnyIO 2.0. Tests are also now run against all supported AnyIO backends, not just curio.

theelous3 commented 4 years ago

Wow! Really nice @agronholm \o/ Looks great. Thank you for this. Very cool to have full-spectrum async support behind the scenes 👍

Side question, as I don't often get a chance for feedback, how did you find working a little bit with overly?

agronholm commented 4 years ago

I found overly to be clunky. I would much rather have used an async server.

theelous3 commented 4 years ago

Yeah I've been meaning to make a less clunky default @Server() in which everything is just available for typical usecases, which would remove the clunkiness if I understand you.

Was there a particular server or reason you'd have preferred async?

agronholm commented 4 years ago

The first problem I encountered was that the decorator was incompatible with anyio's test plugin because the async test functions appear as regular functions due to overly not wrapping them with @functools.wraps. Overly does not appear to support being used as a fixture. I had to dig into the code and set an undocumented attribute in order to get it to stop. I also found that timeouts are not applied to accepted client connections, making them stall forever if there's a problem. Its threaded nature prevents it from being forcibly killed.

You asked why I thought it was clunky – the above should explain.