-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Full rewrite of this crate The main problem was that the API followed the implementation and not the other way round. Some API improvements weren't possible because they weren't implementable. With the new implementation, several API decisions that bothered me were finally improved. ### Breaking Changes - Remove `Toplevel::nested` (which was a rather ugly hack), replace with configurable `ErrorAction`s. - Remove partial shutdown mechanism; replace with `NestedSubsystem::initiate_shutdown()` and `NestedSubsystem::join()`. - Add `SubsystemHandle::wait_for_children()`. - Remove `Toplevel::start`. Instead, add a single subsystem to `Toplevel::new`, which can then spawn all further subsystems. - Rework `SubsystemHandle::start`; it now takes a `SubsystemBuilder` object that provides further subsystem configuration options. - Minimum Supported Rust Version (MSRV) is now `1.63.0`. The rest of the API is almost identical and migration should be mostly straight forward.
- Loading branch information
Showing
52 changed files
with
2,349 additions
and
2,339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,23 @@ jobs: | |
- name: Run cargo test | ||
run: cargo test -- --test-threads 1 | ||
|
||
msrv: | ||
name: Minimum Supported Rust Version | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTFLAGS: "-D warnings" | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install MSRV toolchain | ||
uses: dtolnay/[email protected] | ||
|
||
#- uses: Swatinem/rust-cache@v1 | ||
|
||
- name: Run cargo build | ||
run: cargo build | ||
|
||
lints: | ||
name: Lints | ||
runs-on: ubuntu-latest | ||
|
@@ -115,7 +132,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
environment: production | ||
if: github.event_name == 'release' | ||
needs: [build, test, lints, docs, leaks] | ||
needs: [build, test, msrv, lints, docs, leaks] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
[package] | ||
name = "tokio-graceful-shutdown" | ||
authors = ["Finomnis <[email protected]>"] | ||
version = "0.13.0" | ||
edition = "2018" | ||
version = "0.14.0" | ||
edition = "2021" | ||
rust-version = "1.63" | ||
license = "MIT OR Apache-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/Finomnis/tokio-graceful-shutdown" | ||
|
@@ -20,39 +21,35 @@ exclude = [ | |
] | ||
|
||
[dependencies] | ||
# Error definitions | ||
thiserror = "1.0.32" | ||
miette = "5.3.0" | ||
tracing = { version = "0.1.37", default-features = false } | ||
|
||
# For async utilities | ||
tokio = { version = "1.20.1", default-features = false, features = [ | ||
tokio = { version = "1.32.0", default-features = false, features = [ | ||
"signal", | ||
"rt", | ||
"macros", | ||
"time", | ||
] } | ||
tokio-util = { version = "0.7.2", default-features = false } | ||
futures = "0.3.23" | ||
async-recursion = "1.0.0" | ||
pin-project-lite = "0.2.9" | ||
tokio-util = { version = "0.7.8", default-features = false } | ||
|
||
# For 'IntoSubsystem' trait | ||
async-trait = "0.1.57" | ||
|
||
# For logging | ||
log = "0.4.17" | ||
pin-project-lite = "0.2.13" | ||
thiserror = "1.0.49" | ||
miette = "5.10.0" | ||
async-trait = "0.1.73" | ||
atomic = "0.6.0" | ||
bytemuck = { version = "1.14.0", features = ["derive"] } | ||
|
||
[dev-dependencies] | ||
# Error propagation | ||
anyhow = "1.0.61" | ||
anyhow = "1.0.75" | ||
eyre = "0.6.8" | ||
miette = { version = "5.3.0", features = ["fancy"] } | ||
miette = { version = "5.10.0", features = ["fancy"] } | ||
|
||
# Logging | ||
env_logger = "0.10.0" | ||
tracing-subscriber = "0.3.17" | ||
tracing-test = "0.2.4" | ||
|
||
# Tokio | ||
tokio = { version = "1.20.1", features = ["full"] } | ||
tokio = { version = "1.32.0", features = ["full"] } | ||
|
||
# Hyper example | ||
hyper = { version = "0.14.20", features = ["full"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.