connect: add single method for Stream class #98
Merged
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 multiple changes across client, server, and core library files to improve code clarity, consistency, and functionality. Key updates include simplifying streaming request handling, fixing typos in method names, and enhancing documentation for better readability and maintainability.
Improvements to streaming request handling:
examples/client.py: Replacedensure_singlewith the newsinglemethod for handling single messages in streaming requests. This simplifies client-side streaming logic. [1] [2]examples/server.py: Updated server-side streaming logic to use thesinglemethod instead ofensure_single.src/connect/connect.py: Added thesinglemethod toStreamRequestandStreamResponseclasses for consistent handling of single messages in streaming contexts. [1] [2]Fixes and consistency updates:
src/connect/client.py: Corrected typos in method names (recieve_*changed toreceive_*) to ensure consistent naming conventions. [1] [2] [3]src/connect/connect.py: Updated method names and logic to align with the corrected naming conventions. [1] [2] [3]Documentation enhancements:
src/connect/connect.py: Improved class and method docstrings forRequestCommon,StreamRequest,UnaryRequest, andStreamResponseto provide clearer descriptions of attributes, parameters, and usage examples. [1] [2] [3] [4]These changes collectively enhance the usability, readability, and maintainability of the codebase while ensuring consistent functionality across different components.