Skip to content

perf(http): Optimize the overhead of boundary checks for streaming types#56

Merged
0x676e67 merged 1 commit intomainfrom
feat
Feb 22, 2025
Merged

perf(http): Optimize the overhead of boundary checks for streaming types#56
0x676e67 merged 1 commit intomainfrom
feat

Conversation

@0x676e67
Copy link
Copy Markdown
Owner

This pull request includes several important changes to improve the handling of asynchronous streaming and simplify the codebase. The main changes involve updating the Client and Response classes, as well as renaming and refactoring files.

Asynchronous Streaming Improvements:

  • examples/stream.py: Updated the main function to use an asynchronous context manager for streaming.
  • rnet.pyi: Added __aenter__ and __aexit__ methods to the Streamer class to support asynchronous context management.

Codebase Simplification:

  • src/client.rs: Simplified the Client implementation by removing redundant calls to pyo3_async_runtimes::tokio::future_into_py and replacing them with future_into_py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • src/response/http/mod.rs: Renamed from src/response/http.rs and refactored to remove the Streamer class definition, moving it to a separate stream module. Updated the Response class methods to use future_into_py for asynchronous operations. [1] [2] [3] [4] [5] [6] [7] [8]

Dependency Updates:

Import Adjustments:

  • src/client.rs: Added import for pyo3_async_runtimes::tokio::future_into_py.…sponse types

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.

1 participant