Repository navigation
Implement true streaming responses - #12
Merged
Merged
Conversation
The core bug was that async_stream.signal_end_of_stream() was never called, causing aread() and async iteration to hang forever waiting for more data. The fix restores proper streaming semantics: - In the streaming path, race headers_ready event against the raw completion future (not a wrapped coroutine, to avoid cancellation orphaning the future) - When headers arrive first: return the response immediately; _finish_streaming runs in the background and signals end-of-stream when the transfer completes - When transfer completes first (small/fast responses): signal end-of-stream inline before returning - _finish_streaming also queues any pycurl errors into the stream so consumers see RemoteProtocolError instead of hanging Result: 1000 parallel requests now complete in ~0.64s vs niquests ~0.71s.
dholth
enabled auto-merge (squash)
April 26, 2026 01:50
- Skip redundant socket registration remove/add cycles when mode hasn't changed - Update test_curl.py tests to work with non-blocking perform() API - perform() now returns PerformHandle immediately instead of being awaitable
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client is able to get headers, wait, get a line of the response, wait, and get another line of response.
Fix #11