Skip to content

Transport API - #129

Merged
lovelydinosaur merged 4 commits into
mainfrom
transport-api
Nov 4, 2026
Merged

lovelydinosaur merged 4 commits into
mainfrom
transport-api

Conversation

@lovelydinosaur

@lovelydinosaur lovelydinosaur commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Refs #114.

  • Remove ResponseStream in favor of SendContext.
    • The result of calling send(...) is a context managed unpackable of (status code, headers, stream)*
  • Remove high-level .stream() API.
    • The low-level transport API .send() supports streaming. At a high-level Stream -> Content is managed by content parsing.

@lovelydinosaur

lovelydinosaur commented Nov 4, 2026 •

Copy link
Copy Markdown
Member Author

Thoughts...

A balanced API here would be...

with transport.send(method, url, headers, stream) as (status, headers, stream):
    ...

This PR works towards that.

@lovelydinosaur
lovelydinosaur requested a review from cgl November 4, 2026 13:20
@lovelydinosaur
lovelydinosaur merged commit 306e859 into main Nov 4, 2026
5 checks passed
@lovelydinosaur
lovelydinosaur deleted the transport-api branch November 4, 2026 15:46

@cgl cgl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 LGTM!

Comment thread tests/test_client.py
Comment on lines +153 to +155
with client.transport.send(request) as (status, _, stream):
assert status == 200
body = stream.read()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very neat 👌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants