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

Refactor Connection to a synchronous state machine #142

Merged
merged 41 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9bd4a34
Fix clippy warnings
thomaseizinger Oct 25, 2022
9af35b8
Remove unnecessary `Option`
thomaseizinger Oct 8, 2022
54296c5
Make `gargabe_collect` not async
thomaseizinger Oct 8, 2022
6234e6f
Handle socket closing outside of `on_control_command`
thomaseizinger Oct 8, 2022
d5d5ef4
Handle GoAway logic outside of `on_stream_command`
thomaseizinger Oct 8, 2022
6a55933
Remove `async` from a bunch of functions
thomaseizinger Oct 8, 2022
c1e805d
Introduce `Connection::poll` function
thomaseizinger Oct 8, 2022
e02bdbc
Minimise diff
thomaseizinger Oct 8, 2022
3a6a374
Split `on_control_command`
thomaseizinger Oct 11, 2022
5e64609
Use whitespace
thomaseizinger Oct 11, 2022
3817398
Split `on_stream_command`
thomaseizinger Oct 11, 2022
0ebd9cc
Prioritise control and stream commands over reading the socket
thomaseizinger Oct 11, 2022
b37e484
Fail if we want to double close a connection
thomaseizinger Oct 11, 2022
f776a43
Introduce internal `ConnectionState` enum
thomaseizinger Oct 11, 2022
d63cde2
Track closed state in connection state enum
thomaseizinger Oct 11, 2022
a1db18e
Inline `on_close_connection`
thomaseizinger Oct 11, 2022
fd886ee
Implement shutdown procedurally
thomaseizinger Oct 12, 2022
527012d
Don't pause `control_receiver`
thomaseizinger Oct 12, 2022
f9d3f4b
Implement `ConnectionState::poll`
thomaseizinger Oct 12, 2022
2df23f0
Implement `into_stream` by directly calling `poll_next`
thomaseizinger Oct 12, 2022
6ca0d1f
Improve naming of `poll` fn on `ConnectionState`
thomaseizinger Oct 12, 2022
bb96cd9
Improve docs
thomaseizinger Oct 12, 2022
ff27080
Don't fail if connection got closed gracefully
thomaseizinger Oct 12, 2022
527df19
Rename `Failing` to `Cleanup`
thomaseizinger Oct 12, 2022
19ee6e8
Add docs to state variants
thomaseizinger Oct 12, 2022
370f5bc
Track reply sender outside of `close` function
thomaseizinger Oct 20, 2022
7dcecde
Handle `ControlCommand` outside of `ConnectionState::poll`
thomaseizinger Oct 20, 2022
fe7d000
Introduce `Frame::close_stream` ctor
thomaseizinger Oct 20, 2022
2bae656
Move `Drop` impl from `Active` to `Connection`
thomaseizinger Oct 20, 2022
47c684b
Implement connection closing as manual state machine
thomaseizinger Oct 20, 2022
8279c27
Implement connection cleanup as manual state machine
thomaseizinger Oct 25, 2022
ce57e25
Don't require `T` to be `Send + 'static'`
thomaseizinger Oct 25, 2022
0ac90a0
Rewrite `Control` to be a layer on top of `Connection`
thomaseizinger Oct 24, 2022
79c1479
Make `control` as sister module of `connection`
thomaseizinger Oct 25, 2022
3941cdc
Add test for poll-based API
thomaseizinger Oct 25, 2022
a0ba23b
Create workspace
thomaseizinger Nov 3, 2022
654e38a
Remove comment and improve variable naming
thomaseizinger Nov 14, 2022
1525cf8
Fix typo
thomaseizinger Nov 14, 2022
27ed7ac
Match exhaustively
thomaseizinger Nov 14, 2022
1ca32e6
Use doc link
thomaseizinger Nov 14, 2022
63938b1
Bump version and add changelog entry
thomaseizinger Nov 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 2 additions & 33 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,2 @@
[package]
name = "yamux"
version = "0.10.2"
authors = ["Parity Technologies <[email protected]>"]
license = "Apache-2.0 OR MIT"
description = "Multiplexer over reliable, ordered connections"
keywords = ["network", "protocol"]
categories = ["network-programming"]
repository = "https://github.com/paritytech/yamux"
readme = "README.md"
edition = "2018"

[dependencies]
futures = { version = "0.3.12", default-features = false, features = ["std"] }
log = "0.4.8"
nohash-hasher = "0.2"
parking_lot = "0.12"
rand = "0.8.3"
static_assertions = "1"

[dev-dependencies]
anyhow = "1"
criterion = "0.4"
env_logger = "0.9"
futures = "0.3.4"
quickcheck = "1.0"
tokio = { version = "1.0", features = ["net", "rt-multi-thread", "macros", "time"] }
tokio-util = { version = "0.7", features = ["compat"] }
constrained-connection = "0.1"

[[bench]]
name = "concurrent"
harness = false
[workspace]
members = ["yamux", "test-harness"]
149 changes: 0 additions & 149 deletions src/connection/control.rs

This file was deleted.

99 changes: 0 additions & 99 deletions src/pause.rs

This file was deleted.

19 changes: 19 additions & 0 deletions test-harness/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "test-harness"
version = "0.1.0"
edition = "2018"
publish = false

[dependencies]
yamux = { path = "../yamux" }
futures = "0.3.4"
quickcheck = "1.0"
tokio = { version = "1.0", features = ["net", "rt-multi-thread", "macros", "time"] }
tokio-util = { version = "0.7", features = ["compat"] }
anyhow = "1"
log = "0.4.17"

[dev-dependencies]
env_logger = "0.9"
constrained-connection = "0.1"

Loading