Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

muxers/mplex: Implement AsyncRead and AsyncWrite for Substream #2705

Conversation

thomaseizinger
Copy link
Contributor

Description

This aligns the public API of the libp2p-mplex module with the one
from libp2p-yamux. This change has two benefits:

  1. For standalone users of libp2p-mplex, the substreams itself are
    now useful, similar to libp2p-yamux and don't necessarily need to
    be polled via the StreamMuxer. The StreamMuxer only forwards to
    the Async{Read,Write} implementations.

  2. This will reduce the diff of core/muxing: Redesign StreamMuxer trait #2648 because we can chunk the one
    giant commit into smaller atomic ones.

Whilst keeping master functional, the state of StreamMuxer is now
a 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

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

This aligns the public API of the `libp2p-mplex` module with the one
from `libp2p-yamux`. This change has two benefits:

1. For standalone users of `libp2p-mplex`, the substreams itself are
now useful, similar to `libp2p-yamux` and don't necessarily need to
be polled via the `StreamMuxer`. The `StreamMuxer` only forwards to
the `Async{Read,Write}` implementations.

2. This will reduce the diff of libp2p#2648 because we can chunk the one
giant commit into smaller atomic ones.
@thomaseizinger
Copy link
Contributor Author

Closing because I am going to repush onto rust-libp2p so I can use stacked PRs.

@thomaseizinger thomaseizinger deleted the refactor/mplex-async-read-write-stream branch June 15, 2022 18:24
@thomaseizinger
Copy link
Contributor Author

See #2706.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant