Conversation
014a4d3 to
696044c
Compare
696044c to
7c58e33
Compare
Contributor
Author
|
Once this is merged I figured we'd cut a release. There's been some bug fixes that it would be good to get a new release for. |
Contributor
|
I will test this branch today... |
This extracts some of the core logic from `TcpConnector` and `TcpTransport` to a more general `StreamConnector` and `StreamTransport`. This is essentially the same as before, except we operate over `AsyncRead` and `AsyncWrite`. To facilite this, users need to provide a generic `C: Fn(...) -> Future<Output = Result<R, W>>`, effectively providing their own custom connection establishment. This makes it possible to have custom transport implementations that don't rely on a raw TCP stream.
7c58e33 to
1d31c60
Compare
svanharmelen
approved these changes
Feb 23, 2026
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 extracts some of the core logic from
TcpConnectorandTcpTransportto a more generalStreamConnectorandStreamTransport. This is essentially the same as before, except we operate overAsyncReadandAsyncWrite. To facilite this, users need to provide a genericC: Fn(...) -> Future<Output = Result<R, W>>, effectively providing their own custom connection establishment.This makes it possible to have custom transport implementations that don't rely on a raw TCP stream. In fact,
TcpTransportis now just a type aliasStreamTransport<ReadHalf<TcpStream>, WriteHalf<TcpStream>>.Getting the correct generic bounds was a little fiddly, but this seems to work pretty well. I consider this to close #194, as it would allow a user to create a
StreamConnectorwith a custom wrapped stream, though not through quite as simple an interface as they request there.