Refactor streams: rename is_*
to wait_*
for clarity
#2069
Merged
+45
−33
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.
is_readable()
withwait_readable()
andis_writable()
withwait_writable()
in the Stream interface.is_readable()
function with semantics that more closely reflect its name. It returns immediately whether data is available for reading, without waiting.is_writable()
, removing redundant checks.Note: The new
is_readable()
capability is essential for the WebSockets code, as there's currently no way to tell ifread()
would block. I have an alternative proposal to addhas_buffered_data()
, which is identical tois_readable()
in this PR. This alternative is less invasive and requires no other code changes, while this PR also aims to enhance semantic clarity.