muxers/mplex: Implement AsyncRead
and AsyncWrite
for Substream
#2705
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.
Description
This aligns the public API of the
libp2p-mplex
module with the onefrom
libp2p-yamux
. This change has two benefits:For standalone users of
libp2p-mplex
, the substreams itself arenow useful, similar to
libp2p-yamux
and don't necessarily need tobe polled via the
StreamMuxer
. TheStreamMuxer
only forwards tothe
Async{Read,Write}
implementations.This will reduce the diff of core/muxing: Redesign
StreamMuxer
trait #2648 because we can chunk the onegiant commit into smaller atomic ones.
Whilst keeping master functional, the state of
StreamMuxer
is nowa bit awkward until we merge #2648. However, given we are already
doing things this way for
libp2p-yamux
it shouldn't be an issue?Links to any relevant issues
Will reduce diff in #2648.
Open Questions
Change checklist