Conversation
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.
This pull request includes several important changes to improve the handling of asynchronous streaming and simplify the codebase. The main changes involve updating the
ClientandResponseclasses, as well as renaming and refactoring files.Asynchronous Streaming Improvements:
examples/stream.py: Updated themainfunction to use an asynchronous context manager for streaming.rnet.pyi: Added__aenter__and__aexit__methods to theStreamerclass to support asynchronous context management.Codebase Simplification:
src/client.rs: Simplified theClientimplementation by removing redundant calls topyo3_async_runtimes::tokio::future_into_pyand replacing them withfuture_into_py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]src/response/http/mod.rs: Renamed fromsrc/response/http.rsand refactored to remove theStreamerclass definition, moving it to a separatestreammodule. Updated theResponseclass methods to usefuture_into_pyfor asynchronous operations. [1] [2] [3] [4] [5] [6] [7] [8]Dependency Updates:
Cargo.toml: Added thebytesdependency.Import Adjustments:
src/client.rs: Added import forpyo3_async_runtimes::tokio::future_into_py.…sponse types