[mplex, yamux] Streamline configuration API. (#1822)

* Streamline mplex and yamux configurations.

  * For all configuration options that exist for both multiplexers
    and have the same semantics, use the same names for the
    configuration.
  * Rename `Config` to `YamuxConfig` for consistentcy with
    the majority of other protocols, e.g. `MplexConfig`, `PingConfig`,
    `KademliaConfig`, etc.
  * Completely hide `yamux` APIs within `libp2p-yamux`. This allows
    to fully control the libp2p API and streamline it with other
    muxer APIs, consciously choosing e.g. which configuration options
    to make configurable in libp2p and which to fix to certain values.
    It does also not necessarily prescribe new incompatible version bumps of
    yamux for `libp2p-yamux`, as no `yamux` types are exposed. The cost
    is some more duplication of configuration options in the API, as well
    as the need to update `libp2p-yamux` if `yamux` introduces new
    configuration options that `libp2p-yamux` wants to expose as well.

* Update CHANGELOGs.
This commit is contained in:
Roman Borschel
2020-11-06 09:46:22 +01:00
committed by GitHub
parent 689eeaf533
commit 2ba78b4ce7
10 changed files with 158 additions and 77 deletions

View File

@ -44,7 +44,7 @@ use libp2p::{
noise,
swarm::NetworkBehaviourEventProcess,
tcp::TcpConfig,
yamux::Config as YamuxConfig,
yamux::YamuxConfig,
Multiaddr, NetworkBehaviour, PeerId, Swarm, Transport,
};
use std::{