-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate the
TCP.Engine.pending_reads
method.
There's no need for this method anymore. Loading pending reads into the read stream will now be handled automatically by the TCP engine, which will yield an `IO.Action.Read` action for each time a pending read is completed. So you can just remove this function call from your code and de-indent the body of your yield block, such that it becomes part of the outer code. If you need to know the number of bytes available, then you can call `io.read_stream.bytes_ahead_of_marker` to find out. For now, calling it will do nothing but yield once with the value of `io.read_stream.bytes_ahead_of_marker` to maintain compatibility. But the method will be removed soon. --- There's no reason why the library user needs to be the one to tell the engine to handle pending reads - it was a bad design from the start, but it also turns out to be a blocker for Windows support, wherein pending reads will work a bit differently. Also it was inconsistent with the `StdIn` library which doesn't have this method in its engine, so that's also cleared up now.
- Loading branch information
Showing
2 changed files
with
38 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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