Repository navigation
First pass async support - #131
lovelydinosaur wants to merge 1 commit into
Conversation
|
@cgl Realise this is a big design question to have on a project that's otherwise becoming fairly well defined, though... ...there's an obvious question here. Which of these platforms are we aiming for?... ...either or both? |
I think we want to support both styles, so we might look for a way to add async support, not replacing sync with async? What do you think? Any cons or blockers there? |
|
The namespacing is sorta the tricky bit. Helpful that our requests and responses are actually immutable and don't have any I/O directly. Eg. We're able to support |
It would actually sort have made more sense to start with async, because...
We could either...
Here's how a mirrored layout might look... backends/
anyio.py
asyncio.py
sync.py
trio.py
core/
content.py
forms.py
headers.py
queryparams.py
request.py
response.py
urlencode.py
urlparse.py
urls.py
async/
client.py
server.py
streams.py
parsers/
httpparser.py
readaheadparser.py
transports/
base.py
connectionpool.py
connection.py
sync/ # mirrored with `unasync`
client.py
server.py
streams.py
parsers/
httpparser.py
readaheadparser.py
transports/
base.py
connectionpool.py
connection.pyThat's assuming we actually want to support both styles. The alternative is we just be super clear about a design choice, only support eg. async, and guide our users towards what we think is the best choice in python circa 2026. In terms of documentation that'd be a sharper choice. Although covering all the bases has v obvious advantages. |
I wanted to checkout adding async support, so here's a first pass at that...