core/muxing: Flatten StreamMuxer interface to poll_{inbound,outbound,address_change,close} (#2724)

Instead of having a mix of `poll_event`, `poll_outbound` and `poll_close`, we
flatten the entire interface of `StreamMuxer` into 4 individual functions:

- `poll_inbound`
- `poll_outbound`
- `poll_address_change`
- `poll_close`

This design is closer to the design of other async traits like `AsyncRead` and
`AsyncWrite`. It also allows us to delete the `StreamMuxerEvent`.
This commit is contained in:
Thomas Eizinger
2022-07-18 04:20:11 +01:00
committed by GitHub
parent d4f8ec2d48
commit 1a553db596
61 changed files with 281 additions and 696 deletions

View File

@ -4,6 +4,8 @@
- Update to `libp2p-request-response` `v0.20.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.5.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -18,7 +18,7 @@ async-trait = "0.1"
futures = "0.3"
futures-timer = "3.0"
instant = "0.1"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
libp2p-request-response = { version = "0.20.0", path = "../request-response" }
log = "0.4"

View File

@ -4,6 +4,8 @@
- Expose `PROTOCOL_NAME`. See [PR 2734].
- Update to `libp2p-core` `v0.35.0`.
[PR 2734]: https://github.com/libp2p/rust-libp2p/pull/2734/
# 0.4.0

View File

@ -17,7 +17,7 @@ either = "1.6.0"
futures = "0.3.1"
futures-timer = "3.0"
instant = "0.1.11"
libp2p-core = { version = "0.34.0", path = "../../core" }
libp2p-core = { version = "0.35.0", path = "../../core" }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4"
prost-codec = { version = "0.1", path = "../../misc/prost-codec" }

View File

@ -2,6 +2,8 @@
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.37.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
cuckoofilter = "0.5.0"
fnv = "1.0"
futures = "0.3.1"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4"
prost = "0.10"

View File

@ -2,6 +2,8 @@
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.39.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
bytes = "1.0"
byteorder = "1.3.4"
fnv = "1.0.7"

View File

@ -4,6 +4,8 @@
- Expose `PROTOCOL_NAME` and `PUSH_PROTOCOL_NAME`. See [PR 2734].
- Update to `libp2p-core` `v0.35.0`.
[PR 2734]: https://github.com/libp2p/rust-libp2p/pull/2734/
# 0.37.0

View File

@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
asynchronous-codec = "0.6"
futures = "0.3.1"
futures-timer = "3.0.2"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4.1"
lru = "0.7.2"

View File

@ -2,6 +2,8 @@
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.38.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -18,7 +18,7 @@ fnv = "1.0"
asynchronous-codec = "0.6"
futures = "0.3.1"
log = "0.4"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
prost = "0.10"
rand = "0.7.2"

View File

@ -2,6 +2,8 @@
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.38.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -17,7 +17,7 @@ dns-parser = "0.8.0"
futures = "0.3.13"
if-watch = "1.0.0"
lazy_static = "1.4.0"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4.14"
rand = "0.8.3"

View File

@ -4,6 +4,8 @@
- Expose `PROTOCOL_NAME`. See [PR 2734].
- Update to `libp2p-core` `v0.35.0`.
[PR 2734]: https://github.com/libp2p/rust-libp2p/pull/2734/
# 0.37.0

View File

@ -14,7 +14,7 @@ categories = ["network-programming", "asynchronous"]
futures = "0.3.1"
futures-timer = "3.0.2"
instant = "0.1.11"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4.1"
rand = "0.7.2"

View File

@ -4,6 +4,8 @@
- Expose `HOP_PROTOCOL_NAME` and `STOP_PROTOCOL_NAME`. See [PR 2734].
- Update to `libp2p-core` `v0.35.0`.
[PR 2734]: https://github.com/libp2p/rust-libp2p/pull/2734/
# 0.10.0

View File

@ -17,7 +17,7 @@ either = "1.6.0"
futures = "0.3.1"
futures-timer = "3"
instant = "0.1.11"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4"
pin-project = "1"

View File

@ -2,6 +2,8 @@
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.7.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"]
[dependencies]
asynchronous-codec = "0.6"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
prost = "0.10"
void = "1"

View File

@ -2,6 +2,8 @@
- Update to `libp2p-swarm` `v0.38.0`.
- Update to `libp2p-core` `v0.35.0`.
# 0.19.0
- Update to `libp2p-core` `v0.34.0`.

View File

@ -15,7 +15,7 @@ async-trait = "0.1"
bytes = "1"
futures = "0.3.1"
instant = "0.1.11"
libp2p-core = { version = "0.34.0", path = "../../core", default-features = false }
libp2p-core = { version = "0.35.0", path = "../../core", default-features = false }
libp2p-swarm = { version = "0.38.0", path = "../../swarm" }
log = "0.4.11"
rand = "0.7"