Merge pull request #432 from tower-rs/2020-spring-clean
2020: merge all the middleware
This commit is contained in:
commit
81cfbab19e
|
@ -46,24 +46,9 @@ jobs:
|
|||
matrix:
|
||||
crate:
|
||||
- tower
|
||||
- tower-balance
|
||||
- tower-buffer
|
||||
- tower-discover
|
||||
- tower-filter
|
||||
- tower-hedge
|
||||
- tower-layer
|
||||
- tower-limit
|
||||
- tower-load
|
||||
- tower-load-shed
|
||||
- tower-make
|
||||
- tower-ready-cache
|
||||
- tower-reconnect
|
||||
- tower-retry
|
||||
- tower-service
|
||||
- tower-spawn-ready
|
||||
- tower-test
|
||||
- tower-timeout
|
||||
- tower-util
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
@ -94,10 +79,53 @@ jobs:
|
|||
uses: actions-rs/cargo@v1
|
||||
env:
|
||||
CI: 'True'
|
||||
RUSTFLAGS: '-D warnings'
|
||||
# RUSTFLAGS: '-D warnings'
|
||||
with:
|
||||
command: test
|
||||
args: -p ${{ matrix.crate }} --verbose
|
||||
args: -p ${{ matrix.crate }} --verbose --all-features
|
||||
|
||||
features:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v1
|
||||
- name: Install rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
override: true
|
||||
- name: Patch
|
||||
run: |
|
||||
set -e
|
||||
# Remove any existing patch statements
|
||||
mv Cargo.toml Cargo.toml.bck
|
||||
sed -n '/\[patch.crates-io\]/q;p' Cargo.toml.bck > Cargo.toml
|
||||
# Patch all crates
|
||||
cat .github/workflows/patch.toml >> Cargo.toml
|
||||
# Print `Cargo.toml` for debugging
|
||||
echo "~~~~ Cargo.toml ~~~~"
|
||||
cat Cargo.toml
|
||||
echo "~~~~~~~~~~~~~~~~~~~~"
|
||||
- name: Install cargo-hack
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: install
|
||||
args: cargo-hack
|
||||
- name: Run feature checks
|
||||
uses: actions-rs/cargo@v1
|
||||
env:
|
||||
CI: 'True'
|
||||
with:
|
||||
command: hack
|
||||
# Check each feature works properly
|
||||
# * --each-feature
|
||||
# run for each feature which includes --no-default-features and default features of package
|
||||
# * -Z avoid-dev-deps
|
||||
# build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
|
||||
# tracking-issue: https://github.com/rust-lang/cargo/issues/5133
|
||||
args: check -p tower --each-feature -Z avoid-dev-deps
|
||||
|
||||
rustfmt:
|
||||
|
||||
|
|
|
@ -2,17 +2,6 @@
|
|||
# repository.
|
||||
[patch.crates-io]
|
||||
tower = { path = "tower" }
|
||||
tower-balance = { path = "tower-balance" }
|
||||
tower-buffer = { path = "tower-buffer" }
|
||||
tower-discover = { path = "tower-discover" }
|
||||
tower-filter = { path = "tower-filter" }
|
||||
tower-layer = { path = "tower-layer" }
|
||||
tower-limit = { path = "tower-limit" }
|
||||
tower-load-shed = { path = "tower-load-shed" }
|
||||
tower-reconnect = { path = "tower-reconnect" }
|
||||
tower-retry = { path = "tower-retry" }
|
||||
tower-service = { path = "tower-service" }
|
||||
tower-spawn-ready = { path = "tower-spawn-ready" }
|
||||
tower-test = { path = "tower-test" }
|
||||
tower-timeout = { path = "tower-timeout" }
|
||||
tower-util = { path = "tower-util" }
|
||||
|
|
15
Cargo.toml
15
Cargo.toml
|
@ -2,22 +2,7 @@
|
|||
|
||||
members = [
|
||||
"tower",
|
||||
"tower-balance",
|
||||
"tower-buffer",
|
||||
"tower-discover",
|
||||
"tower-filter",
|
||||
"tower-hedge",
|
||||
"tower-layer",
|
||||
"tower-limit",
|
||||
"tower-load",
|
||||
"tower-load-shed",
|
||||
"tower-ready-cache",
|
||||
"tower-reconnect",
|
||||
"tower-retry",
|
||||
"tower-service",
|
||||
"tower-spawn-ready",
|
||||
"tower-test",
|
||||
"tower-timeout",
|
||||
"tower-make",
|
||||
"tower-util",
|
||||
]
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
# 0.3.0 (December 4, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `tower-ready-cache 0.3`
|
||||
- Update to `futures 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (unreleased)
|
||||
|
||||
- Initial release
|
|
@ -1,53 +0,0 @@
|
|||
[package]
|
||||
name = "tower-balance"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-balance/0.3.0"
|
||||
description = """
|
||||
Balance load across a set of uniform services.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
log = ["tracing/log"]
|
||||
default = ["log"]
|
||||
|
||||
[dependencies]
|
||||
futures-util = { version = "0.3", default-features = false }
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
pin-project = "0.4"
|
||||
indexmap = "1.0.2"
|
||||
tracing = "0.1"
|
||||
rand = { version = "0.7", features = ["small_rng"] }
|
||||
tokio = { version = "0.2", features = ["sync", "time"] }
|
||||
tower-discover = { version = "0.3", path = "../tower-discover" }
|
||||
tower-layer = "0.3"
|
||||
tower-load = { version = "0.3", path = "../tower-load" }
|
||||
tower-service = "0.3"
|
||||
tower-ready-cache = { version = "0.3", path = "../tower-ready-cache" }
|
||||
tower-make = "0.3"
|
||||
slab = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
tracing-subscriber = "0.1.1"
|
||||
hdrhistogram = "6.0"
|
||||
quickcheck = { version = "0.6", default-features = false }
|
||||
tokio = { version = "0.2", features = ["macros", "stream"] }
|
||||
tokio-test = "0.2"
|
||||
tower-buffer = { version = "0.3", path = "../tower-buffer" }
|
||||
tower-limit = { version = "0.3", path = "../tower-limit" }
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tower = { version = "0.3", path = "../tower" }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Balance
|
||||
|
||||
Balance load across a set of uniform services.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,14 +0,0 @@
|
|||
//! Load balancing middlewares.
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/tower-balance/0.3.0")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
pub mod error;
|
||||
pub mod p2c;
|
||||
pub mod pool;
|
|
@ -1,31 +0,0 @@
|
|||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `tokio 0.2`
|
||||
- Update to `futures-core 0.3`
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `tower-layer 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1b (September 13, 2019)
|
||||
|
||||
- Remove `Stream` unused warning.
|
||||
|
||||
# 0.3.0-alpha.1a (September 13, 2019)
|
||||
|
||||
- Fix `poll_next` not exisitng.
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.1 (July 19, 2019)
|
||||
|
||||
- Add `tracing` support
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,39 +0,0 @@
|
|||
[package]
|
||||
name = "tower-buffer"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-buffer/0.3.0"
|
||||
description = """
|
||||
Buffer requests before dispatching to a `Service`.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
log = ["tracing/log"]
|
||||
default = ["log"]
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
pin-project = "0.4"
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
tokio = { version = "0.2", features = ["rt-core", "sync"] }
|
||||
tracing = "0.1.2"
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio-test = { version = "0.2" }
|
||||
tokio = { version = "0.2", features = ["macros"] }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Buffer
|
||||
|
||||
Buffer requests before dispatching to a `Service`.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,17 +0,0 @@
|
|||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `futures-core 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,27 +0,0 @@
|
|||
[package]
|
||||
name = "tower-discover"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-discover/0.3.0"
|
||||
description = """
|
||||
Abstracts over service discovery strategies.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
tower-service = "0.3"
|
||||
pin-project = "0.4"
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Discovery
|
||||
|
||||
Abstracts over service discovery strategies.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,12 +0,0 @@
|
|||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (unreleased)
|
||||
|
||||
- Initial release
|
|
@ -1,35 +0,0 @@
|
|||
[package]
|
||||
name = "tower-filter"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-filter/0.3.0-alpha.2"
|
||||
description = """
|
||||
Conditionally allow requests to be dispatched to a service based on the result
|
||||
of a predicate.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
pin-project = "0.4"
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
tokio = { version = "0.2", features = ["macros", "sync"] }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,14 +0,0 @@
|
|||
# Tower Filter
|
||||
|
||||
Conditionally allow requests to be dispatched to a service based on the result
|
||||
of a predicate.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,3 +0,0 @@
|
|||
# 0.3.0 (December 4, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,20 +0,0 @@
|
|||
[package]
|
||||
name = "tower-hedge"
|
||||
version = "0.3.0"
|
||||
authors = ["Alex Leong <adlleong@gmail.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
hdrhistogram = "6.0"
|
||||
log = "0.4.1"
|
||||
tower-service = "0.3"
|
||||
tower-filter = { version = "0.3", path = "../tower-filter" }
|
||||
tokio = { version = "0.2", features = ["time"] }
|
||||
futures-util = { version = "0.3", default-features = false }
|
||||
pin-project = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio-test = "0.2"
|
||||
tokio = { version = "0.2", features = ["macros", "test-util"] }
|
|
@ -1,22 +0,0 @@
|
|||
# 0.3.1 (March 25, 2020)
|
||||
|
||||
- Implement `tower_load::Load` for `ConcurrentLimit` and `RateLimit`
|
||||
(#429).
|
||||
|
||||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `futures 0.3`
|
||||
- Update to `tokio 0.2`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,35 +0,0 @@
|
|||
[package]
|
||||
name = "tower-limit"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.3.x" git tag.
|
||||
version = "0.3.1"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-limit/0.3.1"
|
||||
description = """
|
||||
Limit maximum request rate to a `Service`.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
tower-load = "0.3"
|
||||
tokio = { version = "0.2", features = ["time"] }
|
||||
pin-project = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio-test = "0.2"
|
||||
tokio = { version = "0.2", features = ["macros", "test-util"] }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Rate Limit
|
||||
|
||||
Limit maximum request rate to a `Service`.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,18 +0,0 @@
|
|||
#![doc(html_root_url = "https://docs.rs/tower-limit/0.3.1")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
//! Tower middleware for limiting requests.
|
||||
|
||||
pub mod concurrency;
|
||||
pub mod rate;
|
||||
|
||||
pub use crate::{
|
||||
concurrency::{ConcurrencyLimit, ConcurrencyLimitLayer},
|
||||
rate::{RateLimit, RateLimitLayer},
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
# 0.3.0 (December 4, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `futures 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,34 +0,0 @@
|
|||
[package]
|
||||
name = "tower-load-shed"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-load-shed/0.3.0"
|
||||
description = """
|
||||
Immediately reject requests if the inner service is not ready. This is also
|
||||
known as load-shedding.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
pin-project = "0.4"
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio-test = "0.2"
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio = { version = "0.2", features = ["macros"] }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,14 +0,0 @@
|
|||
# Tower Load Shed
|
||||
|
||||
Immediately reject requests if the inner service is not ready. This is also
|
||||
known as load-shedding.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,17 +0,0 @@
|
|||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `tower-discover 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (unreleased)
|
||||
|
||||
- Initial release
|
|
@ -1,35 +0,0 @@
|
|||
[package]
|
||||
name = "tower-load"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-load/0.3.0-alpha.2"
|
||||
description = """
|
||||
Strategies for measuring the load of a service
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
log = "0.4.1"
|
||||
tokio = { version = "0.2", features = ["time"] }
|
||||
tower-service = "0.3"
|
||||
tower-discover = { version = "0.3", path = "../tower-discover" }
|
||||
pin-project = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio-test = "0.2"
|
||||
tokio = { version = "0.2", features = ["macros", "test-util" ] }
|
||||
futures-util = { version = "0.3", default-features = false }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Load
|
||||
|
||||
Provides strategies for measuring a service's load.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,26 +0,0 @@
|
|||
# 0.3.0 (November 29, 2019)
|
||||
|
||||
- Update `tokio` to `0.2`.
|
||||
- Rename `io` feature to `connect`.
|
||||
|
||||
# 0.3.0-alpha.2a (September 30, 2019)
|
||||
|
||||
- Update `tokio-io` to `alpha.6`
|
||||
- Update `tower-service` to `alpha.2`
|
||||
|
||||
# 0.3.0-alpha.2 (September 20, 2019)
|
||||
|
||||
- Update `tokio-io` to `alpha.5`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Bump version to match all the other crates with `std::future`
|
||||
|
||||
# 0.1.0-alpha.2 (August 30, 2019)
|
||||
|
||||
- Update `tokio-io` to `alpha.4`
|
||||
|
||||
|
||||
# 0.1.0-alpha.1 (August 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,21 +0,0 @@
|
|||
[package]
|
||||
name = "tower-make"
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-make/0.3.0"
|
||||
description = """
|
||||
Trait aliases for Services that produce specific types of Responses.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
connect = ["tokio"]
|
||||
|
||||
[dependencies]
|
||||
tower-service = "0.3"
|
||||
tokio = { version = "0.2", optional = true }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Service Makers
|
||||
|
||||
Trait aliases for Services that produce specific types of Responses.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,21 +0,0 @@
|
|||
#![doc(html_root_url = "https://docs.rs/tower-make/0.3.0")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
|
||||
//! Trait aliases for Services that produce specific types of Responses.
|
||||
|
||||
#[cfg(feature = "connect")]
|
||||
mod make_connection;
|
||||
mod make_service;
|
||||
|
||||
#[cfg(feature = "connect")]
|
||||
pub use crate::make_connection::MakeConnection;
|
||||
pub use crate::make_service::MakeService;
|
||||
|
||||
mod sealed {
|
||||
pub trait Sealed<T> {}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
# 0.3.1 (February 24, 2020)
|
||||
|
||||
- Fix spurious panic (#420).
|
||||
- Restore assertion from pre-`std::future::Future` (#418).
|
||||
- Fix documentation URLs to point to 0.3.
|
|
@ -1,35 +0,0 @@
|
|||
[package]
|
||||
name = "tower-ready-cache"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.1"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-ready-cache/0.3.1"
|
||||
description = """
|
||||
Caches a set of services
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
indexmap = "1.0.2"
|
||||
log = "0.4.1"
|
||||
tokio = { version = "0.2", features = ["sync"] }
|
||||
tower-service = "0.3"
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio-test = "0.2"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# Tower Ready Cache
|
||||
|
||||
Provides a set of ready services.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
//! A cache of services
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/tower-ready-cache/0.3.1")]
|
||||
#![deny(missing_docs)]
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
pub mod cache;
|
||||
pub mod error;
|
||||
|
||||
pub use self::cache::ReadyCache;
|
|
@ -1,16 +0,0 @@
|
|||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (unreleased)
|
||||
|
||||
- Initial release
|
|
@ -1,28 +0,0 @@
|
|||
[package]
|
||||
name = "tower-reconnect"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-reconnect/0.3.0-alpha.2"
|
||||
description = """
|
||||
Automatically recreate a new `Service` instance when an error is encountered.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
log = "0.4.1"
|
||||
tower-service = "0.3"
|
||||
tower-make = "0.3"
|
||||
pin-project = "0.4"
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Reconnect
|
||||
|
||||
Automatically recreate a new `Service` instance when an error is encountered.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,19 +0,0 @@
|
|||
# 0.3.0 (December 4, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `tower-layer 0.3`
|
||||
- Update to `tokio 0.2`
|
||||
- Update to `futures-core 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,35 +0,0 @@
|
|||
[package]
|
||||
name = "tower-retry"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-retry/0.3.0"
|
||||
description = """
|
||||
Retry failed requests.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
tokio = { version = "0.2", features = ["time"] }
|
||||
pin-project = "0.4"
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio = { version = "0.2", features = ["macros", "test-util"] }
|
||||
tokio-test = "0.2"
|
||||
futures-util = { version = "0.3", default-features = false }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Retry
|
||||
|
||||
Retry failed requests.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,16 +0,0 @@
|
|||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
- Update to `tokio 0.2`
|
||||
- Remove `Executor` usage
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (unreleased)
|
|
@ -1,35 +0,0 @@
|
|||
[package]
|
||||
name = "tower-spawn-ready"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-spawn-ready/0.3.0-alpha.2"
|
||||
description = """
|
||||
Drives service readiness via a spawned task
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
futures-util = { version = "0.3", default-features = false }
|
||||
pin-project = "0.4"
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
tokio = { version = "0.2", features = ["sync"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tokio-test = "0.2"
|
||||
tokio = { version = "0.2", features = ["macros"] }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Spawn Ready
|
||||
|
||||
Spawn Ready ensures that its inner service is driven to readiness on an executor. Useful with pooling layers that may poll their inner service infrequently.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,23 +0,0 @@
|
|||
#![doc(html_root_url = "https://docs.rs/tower-spawn-ready/0.3.0")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
//! When an underlying service is not ready, drive it to readiness on a
|
||||
//! background task.
|
||||
|
||||
pub mod future;
|
||||
mod layer;
|
||||
mod make;
|
||||
mod service;
|
||||
|
||||
pub use crate::layer::SpawnReadyLayer;
|
||||
pub use crate::make::{MakeFuture, MakeSpawnReady};
|
||||
pub use crate::service::SpawnReady;
|
||||
|
||||
/// Errors produced by `SpawnReady`.
|
||||
pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>;
|
|
@ -24,10 +24,10 @@ edition = "2018"
|
|||
[dependencies]
|
||||
futures-util = { version = "0.3", default-features = false }
|
||||
tokio = { version = "0.2", features = ["sync"]}
|
||||
tower-layer = "0.3"
|
||||
tower-layer = { version = "0.3", path = "../tower-layer" }
|
||||
tokio-test = "0.2"
|
||||
tower-service = "0.3"
|
||||
tower-service = { version = "0.3", path = "../tower-service" }
|
||||
pin-project = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "0.2", features = ["macros"] }
|
||||
tokio = { version = "0.2", features = ["macros"] }
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# 0.3.0 (December 1, 2019)
|
||||
|
||||
- Update to `tower-service 0.3`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.1 (July 30th, 2019)
|
||||
|
||||
- Add `Elapsed::new`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,28 +0,0 @@
|
|||
[package]
|
||||
name = "tower-timeout"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.3.x" git tag.
|
||||
version = "0.3.0"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-timeout/0.3.0"
|
||||
description = """
|
||||
Apply a timeout to requests, ensuring completion within a fixed time duration.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
tower-service = "0.3"
|
||||
tower-layer = "0.3"
|
||||
tokio = { version = "0.2", features = ["time"] }
|
||||
pin-project = "0.4"
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Timeout
|
||||
|
||||
Apply a timeout to requests, ensuring completion within a fixed time duration.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,28 +0,0 @@
|
|||
# 0.3.1 (March 23, 2020)
|
||||
|
||||
- Adds `ReadyAnd` and `ServiceExt::ready_and`, which yield `&mut` to the
|
||||
service when it is ready (#427).
|
||||
- Adds `ReadyOneshot` and `ServiceExt::ready_oneshot`, which yield the
|
||||
service when it is ready (#427).
|
||||
- Updates `Ready` and `ServiceExt::ready` documentation to reflect that
|
||||
they do not yield the service, just unit, when the service is ready
|
||||
(#427).
|
||||
|
||||
# 0.3.0 (December 19, 2019)
|
||||
|
||||
- Update to `tower-serivce 0.3`
|
||||
- Update to `futures 0.3`
|
||||
- Update to `tokio 0.2`
|
||||
|
||||
# 0.3.0-alpha.2 (September 30, 2019)
|
||||
|
||||
- Move to `futures-*-preview 0.3.0-alpha.19`
|
||||
- Move to `pin-project 0.4`
|
||||
|
||||
# 0.3.0-alpha.1 (September 11, 2019)
|
||||
|
||||
- Move to `std::future`
|
||||
|
||||
# 0.1.0 (April 26, 2019)
|
||||
|
||||
- Initial release
|
|
@ -1,41 +0,0 @@
|
|||
[package]
|
||||
|
||||
name = "tower-util"
|
||||
# When releasing to crates.io:
|
||||
# - Remove path dependencies
|
||||
# - Update html_root_url.
|
||||
# - Update doc url
|
||||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.3.x" git tag.
|
||||
version = "0.3.1"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/tower-rs/tower"
|
||||
homepage = "https://github.com/tower-rs/tower"
|
||||
documentation = "https://docs.rs/tower-util/0.3.1"
|
||||
description = """
|
||||
Utilities for working with `Service`.
|
||||
"""
|
||||
categories = ["asynchronous", "network-programming"]
|
||||
edition = "2018"
|
||||
|
||||
[features]
|
||||
default = ["call-all"]
|
||||
call-all = ["futures-util"]
|
||||
|
||||
[dependencies]
|
||||
tower-service = "0.3"
|
||||
pin-project = "0.4"
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
|
||||
# Optional
|
||||
|
||||
futures-util = { version = "0.3", optional = true, default-features = false, features = ["alloc"] }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio-test = "0.2"
|
||||
tokio = { version = "0.2", features = ["stream", "sync", "macros"] }
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
|
@ -1,25 +0,0 @@
|
|||
Copyright (c) 2019 Tower Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,13 +0,0 @@
|
|||
# Tower Service Util
|
||||
|
||||
Utilities for working with `Service`.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [MIT license](LICENSE).
|
||||
|
||||
### Contribution
|
||||
|
||||
Unless you explicitly state otherwise, any contribution intentionally submitted
|
||||
for inclusion in Tower by you, shall be licensed as MIT, without any additional
|
||||
terms or conditions.
|
|
@ -1,3 +1,19 @@
|
|||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
- All middleware `tower-*` crates were merged into `tower` and placed
|
||||
behind feature flags.
|
||||
|
||||
### Removed
|
||||
|
||||
# 0.3.1 (January 17, 2020)
|
||||
|
||||
- Allow opting out of tracing/log (#410).
|
||||
|
|
|
@ -7,7 +7,7 @@ name = "tower"
|
|||
# - Cargo.toml
|
||||
# - README.md
|
||||
# - Update CHANGELOG.md.
|
||||
# - Create "v0.1.x" git tag.
|
||||
# - Create "vX.X.X" git tag.
|
||||
version = "0.3.1"
|
||||
authors = ["Tower Maintainers <team@tower-rs.com>"]
|
||||
license = "MIT"
|
||||
|
@ -24,26 +24,45 @@ keywords = ["io", "async", "non-blocking", "futures", "service"]
|
|||
edition = "2018"
|
||||
|
||||
[features]
|
||||
default = ["full", "log"]
|
||||
full = []
|
||||
log = ["tower-buffer/log"]
|
||||
default = ["log"]
|
||||
log = ["tracing/log"]
|
||||
balance = ["discover", "load", "ready-cache", "make", "rand", "slab"]
|
||||
buffer = ["tokio/sync", "tokio/rt-core"]
|
||||
discover = []
|
||||
filter = []
|
||||
hedge = ["filter", "futures-util", "hdrhistogram", "tokio/time"]
|
||||
limit = ["tokio/time"]
|
||||
load = ["discover", "tokio/time"]
|
||||
load-shed = []
|
||||
make = ["tokio/io-std"]
|
||||
ready-cache = ["futures-util", "indexmap", "tokio/sync"]
|
||||
reconnect = ["make", "tokio/io-std"]
|
||||
retry = ["tokio/time"]
|
||||
spawn-ready = ["futures-util", "tokio/sync", "tokio/rt-core"]
|
||||
timeout = ["tokio/time"]
|
||||
util = ["futures-util"]
|
||||
|
||||
[dependencies]
|
||||
tower-buffer = { version = "0.3", path = "../tower-buffer", default-features = false }
|
||||
tower-discover = { version = "0.3", path = "../tower-discover" }
|
||||
tower-layer = "0.3"
|
||||
tower-limit = { version = "0.3", path = "../tower-limit" }
|
||||
tower-load-shed = { version = "0.3", path = "../tower-load-shed" }
|
||||
tower-retry = { version = "0.3", path = "../tower-retry" }
|
||||
tower-service = "0.3"
|
||||
tower-timeout = { version = "0.3", path = "../tower-timeout" }
|
||||
tower-util = { version = "0.3", path = "../tower-util", features = ["call-all"] }
|
||||
futures-core = { version = "0.3", default-features = false }
|
||||
futures-core = "0.3"
|
||||
pin-project = "0.4"
|
||||
tower-layer = { version = "0.3", path = "../tower-layer" }
|
||||
tower-service = { version = "0.3", path = "../tower-service" }
|
||||
tracing = "0.1.2"
|
||||
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
|
||||
hdrhistogram = { version = "6.0", optional = true }
|
||||
indexmap = { version = "1.0.2", optional = true }
|
||||
rand = { version = "0.7", features = ["small_rng"], optional = true }
|
||||
slab = { version = "0.4", optional = true }
|
||||
tokio = { version = "0.2", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# env_logger = { version = "0.5.3", default-features = false }
|
||||
futures-util = { version = "0.3", default-features = false }
|
||||
tokio = { version = "0.2", features = ["macros"] }
|
||||
# log = "0.4.1"
|
||||
# # tokio = "0.2"
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
hdrhistogram = "6.0"
|
||||
quickcheck = { version = "0.6", default-features = false }
|
||||
tokio = { version = "0.2", features = ["macros", "stream", "sync", "test-util" ] }
|
||||
tokio-test = "0.2"
|
||||
tower-test = { version = "0.3", path = "../tower-test" }
|
||||
tracing-subscriber = "0.1.1"
|
||||
# env_logger = { version = "0.5.3", default-features = false }
|
||||
# log = "0.4.1"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
//! Load balancing middlewares.
|
||||
|
||||
pub mod error;
|
||||
pub mod p2c;
|
||||
pub mod pool;
|
|
@ -1,5 +1,6 @@
|
|||
use super::super::error;
|
||||
use super::Balance;
|
||||
use crate::error;
|
||||
use crate::discover::Discover;
|
||||
use futures_core::ready;
|
||||
use pin_project::pin_project;
|
||||
use rand::{rngs::SmallRng, SeedableRng};
|
||||
|
@ -9,7 +10,6 @@ use std::{
|
|||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower_discover::Discover;
|
||||
use tower_service::Service;
|
||||
|
||||
/// Makes `Balancer`s given an inner service that makes `Discover`s.
|
|
@ -1,4 +1,7 @@
|
|||
use crate::error;
|
||||
use super::super::error;
|
||||
use crate::discover::{Change, Discover};
|
||||
use crate::load::Load;
|
||||
use crate::ready_cache::{error::Failed, ReadyCache};
|
||||
use futures_core::ready;
|
||||
use futures_util::future::{self, TryFutureExt};
|
||||
use pin_project::pin_project;
|
||||
|
@ -11,9 +14,6 @@ use std::{
|
|||
task::{Context, Poll},
|
||||
};
|
||||
use tokio::sync::oneshot;
|
||||
use tower_discover::{Change, Discover};
|
||||
use tower_load::Load;
|
||||
use tower_ready_cache::{error::Failed, ReadyCache};
|
||||
use tower_service::Service;
|
||||
use tracing::{debug, trace};
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::discover::ServiceList;
|
||||
use crate::load;
|
||||
use futures_util::pin_mut;
|
||||
use std::task::Poll;
|
||||
use tokio_test::{assert_pending, assert_ready, assert_ready_ok, task};
|
||||
use tower_discover::ServiceList;
|
||||
use tower_load as load;
|
||||
use tower_test::{assert_request_eq, mock};
|
||||
|
||||
use super::*;
|
|
@ -14,8 +14,11 @@
|
|||
//! added or removed.
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use super::error;
|
||||
use super::p2c::Balance;
|
||||
use crate::error;
|
||||
use crate::discover::{Change, Discover};
|
||||
use crate::load::Load;
|
||||
use crate::make::MakeService;
|
||||
use futures_core::ready;
|
||||
use pin_project::pin_project;
|
||||
use slab::Slab;
|
||||
|
@ -25,9 +28,6 @@ use std::{
|
|||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower_discover::{Change, Discover};
|
||||
use tower_load::Load;
|
||||
use tower_make::MakeService;
|
||||
use tower_service::Service;
|
||||
|
||||
#[cfg(test)]
|
|
@ -1,6 +1,6 @@
|
|||
use crate::load;
|
||||
use futures_util::pin_mut;
|
||||
use tokio_test::{assert_pending, assert_ready, assert_ready_ok, task};
|
||||
use tower_load as load;
|
||||
use tower_test::{assert_request_eq, mock};
|
||||
|
||||
use super::*;
|
|
@ -1,6 +1,6 @@
|
|||
//! Future types
|
||||
|
||||
use crate::{
|
||||
use super::{
|
||||
error::{Closed, Error},
|
||||
message,
|
||||
};
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{error::Error, service::Buffer};
|
||||
use super::{error::Error, service::Buffer};
|
||||
use std::{fmt, marker::PhantomData};
|
||||
use tower_layer::Layer;
|
||||
use tower_service::Service;
|
|
@ -1,4 +1,4 @@
|
|||
use crate::error::ServiceError;
|
||||
use super::error::ServiceError;
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
/// Message sent over buffer
|
|
@ -1,12 +1,3 @@
|
|||
#![doc(html_root_url = "https://docs.rs/tower-buffer/0.3.0")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
//! Buffer requests when the inner service is out of capacity.
|
||||
//!
|
||||
//! Buffering works by spawning a new task that is dedicated to pulling requests
|
||||
|
@ -21,5 +12,5 @@ mod message;
|
|||
mod service;
|
||||
mod worker;
|
||||
|
||||
pub use crate::layer::BufferLayer;
|
||||
pub use crate::service::Buffer;
|
||||
pub use self::layer::BufferLayer;
|
||||
pub use self::service::Buffer;
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{
|
||||
use super::{
|
||||
error::Error,
|
||||
future::ResponseFuture,
|
||||
message::Message,
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{
|
||||
use super::{
|
||||
error::{Closed, Error, ServiceError},
|
||||
message::Message,
|
||||
};
|
|
@ -1,16 +1,8 @@
|
|||
//! Builder types to compose layers and services
|
||||
|
||||
use crate::{
|
||||
buffer::BufferLayer,
|
||||
limit::{concurrency::ConcurrencyLimitLayer, rate::RateLimitLayer},
|
||||
load_shed::LoadShedLayer,
|
||||
retry::RetryLayer,
|
||||
timeout::TimeoutLayer,
|
||||
};
|
||||
|
||||
use tower_layer::{Identity, Layer, Stack};
|
||||
|
||||
use std::{fmt, time::Duration};
|
||||
use std::fmt;
|
||||
|
||||
/// Declaratively construct Service values.
|
||||
///
|
||||
|
@ -37,8 +29,11 @@ use std::{fmt, time::Duration};
|
|||
/// `service` will be last to see the request.
|
||||
///
|
||||
/// ```
|
||||
/// # // this (and other) doctest is ignored because we don't have a way
|
||||
/// # // to say that it should only be run with cfg(feature = "...")
|
||||
/// # use tower::Service;
|
||||
/// # use tower::builder::ServiceBuilder;
|
||||
/// #[cfg(all(feature = "buffer", feature = "limit"))]
|
||||
/// # async fn wrap<S>(svc: S) where S: Service<(), Error = &'static str> + 'static + Send, S::Future: Send {
|
||||
/// ServiceBuilder::new()
|
||||
/// .buffer(100)
|
||||
|
@ -57,6 +52,7 @@ use std::{fmt, time::Duration};
|
|||
/// ```
|
||||
/// # use tower::Service;
|
||||
/// # use tower::builder::ServiceBuilder;
|
||||
/// #[cfg(all(feature = "buffer", feature = "limit"))]
|
||||
/// # async fn wrap<S>(svc: S) where S: Service<(), Error = &'static str> + 'static + Send, S::Future: Send {
|
||||
/// ServiceBuilder::new()
|
||||
/// .concurrency_limit(10)
|
||||
|
@ -77,7 +73,9 @@ use std::{fmt, time::Duration};
|
|||
/// ```
|
||||
/// # use tower::Service;
|
||||
/// # use tower::builder::ServiceBuilder;
|
||||
/// # use tower_limit::concurrency::ConcurrencyLimitLayer;
|
||||
/// # #[cfg(feature = "limit")]
|
||||
/// # use tower::limit::concurrency::ConcurrencyLimitLayer;
|
||||
/// #[cfg(feature = "limit")]
|
||||
/// # async fn wrap<S>(svc: S) where S: Service<(), Error = &'static str> + 'static + Send, S::Future: Send {
|
||||
/// ServiceBuilder::new()
|
||||
/// .concurrency_limit(5)
|
||||
|
@ -93,6 +91,7 @@ use std::{fmt, time::Duration};
|
|||
/// # use tower::Service;
|
||||
/// # use tower::builder::ServiceBuilder;
|
||||
/// # use std::time::Duration;
|
||||
/// #[cfg(all(feature = "buffer", feature = "limit"))]
|
||||
/// # async fn wrap<S>(svc: S) where S: Service<(), Error = &'static str> + 'static + Send, S::Future: Send {
|
||||
/// ServiceBuilder::new()
|
||||
/// .buffer(5)
|
||||
|
@ -125,8 +124,12 @@ impl<L> ServiceBuilder<L> {
|
|||
}
|
||||
|
||||
/// Buffer requests when when the next layer is out of capacity.
|
||||
pub fn buffer<Request>(self, bound: usize) -> ServiceBuilder<Stack<BufferLayer<Request>, L>> {
|
||||
self.layer(BufferLayer::new(bound))
|
||||
#[cfg(feature = "buffer")]
|
||||
pub fn buffer<Request>(
|
||||
self,
|
||||
bound: usize,
|
||||
) -> ServiceBuilder<Stack<crate::buffer::BufferLayer<Request>, L>> {
|
||||
self.layer(crate::buffer::BufferLayer::new(bound))
|
||||
}
|
||||
|
||||
/// Limit the max number of in-flight requests.
|
||||
|
@ -134,8 +137,12 @@ impl<L> ServiceBuilder<L> {
|
|||
/// A request is in-flight from the time the request is received until the
|
||||
/// response future completes. This includes the time spent in the next
|
||||
/// layers.
|
||||
pub fn concurrency_limit(self, max: usize) -> ServiceBuilder<Stack<ConcurrencyLimitLayer, L>> {
|
||||
self.layer(ConcurrencyLimitLayer::new(max))
|
||||
#[cfg(feature = "limit")]
|
||||
pub fn concurrency_limit(
|
||||
self,
|
||||
max: usize,
|
||||
) -> ServiceBuilder<Stack<crate::limit::ConcurrencyLimitLayer, L>> {
|
||||
self.layer(crate::limit::ConcurrencyLimitLayer::new(max))
|
||||
}
|
||||
|
||||
/// Drop requests when the next layer is unable to respond to requests.
|
||||
|
@ -146,13 +153,19 @@ impl<L> ServiceBuilder<L> {
|
|||
///
|
||||
/// `load_shed` immediately responds with an error when the next layer is
|
||||
/// out of capacity.
|
||||
pub fn load_shed(self) -> ServiceBuilder<Stack<LoadShedLayer, L>> {
|
||||
self.layer(LoadShedLayer::new())
|
||||
#[cfg(feature = "load-shed")]
|
||||
pub fn load_shed(self) -> ServiceBuilder<Stack<crate::load_shed::LoadShedLayer, L>> {
|
||||
self.layer(crate::load_shed::LoadShedLayer::new())
|
||||
}
|
||||
|
||||
/// Limit requests to at most `num` per the given duration
|
||||
pub fn rate_limit(self, num: u64, per: Duration) -> ServiceBuilder<Stack<RateLimitLayer, L>> {
|
||||
self.layer(RateLimitLayer::new(num, per))
|
||||
#[cfg(feature = "limit")]
|
||||
pub fn rate_limit(
|
||||
self,
|
||||
num: u64,
|
||||
per: std::time::Duration,
|
||||
) -> ServiceBuilder<Stack<crate::limit::RateLimitLayer, L>> {
|
||||
self.layer(crate::limit::RateLimitLayer::new(num, per))
|
||||
}
|
||||
|
||||
/// Retry failed requests.
|
||||
|
@ -160,16 +173,21 @@ impl<L> ServiceBuilder<L> {
|
|||
/// `policy` must implement [`Policy`].
|
||||
///
|
||||
/// [`Policy`]: ../retry/trait.Policy.html
|
||||
pub fn retry<P>(self, policy: P) -> ServiceBuilder<Stack<RetryLayer<P>, L>> {
|
||||
self.layer(RetryLayer::new(policy))
|
||||
#[cfg(feature = "retry")]
|
||||
pub fn retry<P>(self, policy: P) -> ServiceBuilder<Stack<crate::retry::RetryLayer<P>, L>> {
|
||||
self.layer(crate::retry::RetryLayer::new(policy))
|
||||
}
|
||||
|
||||
/// Fail requests that take longer than `timeout`.
|
||||
///
|
||||
/// If the next layer takes more than `timeout` to respond to a request,
|
||||
/// processing is terminated and an error is returned.
|
||||
pub fn timeout(self, timeout: Duration) -> ServiceBuilder<Stack<TimeoutLayer, L>> {
|
||||
self.layer(TimeoutLayer::new(timeout))
|
||||
#[cfg(feature = "timeout")]
|
||||
pub fn timeout(
|
||||
self,
|
||||
timeout: std::time::Duration,
|
||||
) -> ServiceBuilder<Stack<crate::timeout::TimeoutLayer, L>> {
|
||||
self.layer(crate::timeout::TimeoutLayer::new(timeout))
|
||||
}
|
||||
|
||||
/// Obtains the underlying `Layer` implementation.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{error::Never, Change, Discover};
|
||||
use super::{error::Never, Change, Discover};
|
||||
use pin_project::pin_project;
|
||||
use std::iter::{Enumerate, IntoIterator};
|
||||
use std::{
|
|
@ -1,12 +1,3 @@
|
|||
#![doc(html_root_url = "https://docs.rs/tower-discover/0.3.0")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
//! # Tower service discovery
|
||||
//!
|
||||
//! Service discovery is the automatic detection of services available to the
|
||||
|
@ -18,7 +9,7 @@ mod error;
|
|||
mod list;
|
||||
mod stream;
|
||||
|
||||
pub use crate::{list::ServiceList, stream::ServiceStream};
|
||||
pub use self::{list::ServiceList, stream::ServiceStream};
|
||||
|
||||
use std::hash::Hash;
|
||||
use std::ops;
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{Change, Discover};
|
||||
use super::{Change, Discover};
|
||||
use futures_core::{ready, TryStream};
|
||||
use pin_project::pin_project;
|
||||
use std::hash::Hash;
|
|
@ -1,6 +1,6 @@
|
|||
//! Future types
|
||||
|
||||
use crate::error::{self, Error};
|
||||
use super::error::{self, Error};
|
||||
use futures_core::ready;
|
||||
use pin_project::{pin_project, project};
|
||||
use std::{
|
|
@ -1,4 +1,4 @@
|
|||
use crate::Filter;
|
||||
use super::Filter;
|
||||
use tower_layer::Layer;
|
||||
|
||||
/// Conditionally dispatch requests to the inner service based on a predicate.
|
|
@ -1,12 +1,3 @@
|
|||
#![doc(html_root_url = "https://docs.rs/tower-filter/0.3.0-alpha.2")]
|
||||
#![warn(
|
||||
missing_debug_implementations,
|
||||
missing_docs,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
//! Conditionally dispatch requests to the inner service based on the result of
|
||||
//! a predicate.
|
||||
|
||||
|
@ -15,9 +6,9 @@ pub mod future;
|
|||
mod layer;
|
||||
mod predicate;
|
||||
|
||||
pub use crate::{layer::FilterLayer, predicate::Predicate};
|
||||
pub use self::{layer::FilterLayer, predicate::Predicate};
|
||||
|
||||
use crate::{error::Error, future::ResponseFuture};
|
||||
use self::{error::Error, future::ResponseFuture};
|
||||
use futures_core::ready;
|
||||
use std::task::{Context, Poll};
|
||||
use tower_service::Service;
|
|
@ -1,4 +1,4 @@
|
|||
use crate::error::Error;
|
||||
use super::error::Error;
|
||||
use std::future::Future;
|
||||
|
||||
/// Checks a request
|
|
@ -8,8 +8,8 @@
|
|||
unreachable_pub
|
||||
)]
|
||||
|
||||
use crate::filter::Filter;
|
||||
use futures_util::future;
|
||||
use log::error;
|
||||
use pin_project::pin_project;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
|
@ -17,7 +17,7 @@ use std::{
|
|||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tower_filter::Filter;
|
||||
use tracing::error;
|
||||
|
||||
mod delay;
|
||||
mod latency;
|
||||
|
@ -220,13 +220,13 @@ impl latency::Record for Histo {
|
|||
}
|
||||
}
|
||||
|
||||
impl<P, Request> tower_filter::Predicate<Request> for PolicyPredicate<P>
|
||||
impl<P, Request> crate::filter::Predicate<Request> for PolicyPredicate<P>
|
||||
where
|
||||
P: Policy<Request>,
|
||||
{
|
||||
type Future = future::Either<
|
||||
future::Ready<Result<(), tower_filter::error::Error>>,
|
||||
future::Pending<Result<(), tower_filter::error::Error>>,
|
||||
future::Ready<Result<(), crate::filter::error::Error>>,
|
||||
future::Pending<Result<(), crate::filter::error::Error>>,
|
||||
>;
|
||||
|
||||
fn check(&mut self, request: &Request) -> Self::Future {
|
|
@ -1,7 +1,7 @@
|
|||
use hdrhistogram::Histogram;
|
||||
use log::trace;
|
||||
use std::time::Duration;
|
||||
use tokio::time::Instant;
|
||||
use tracing::trace;
|
||||
|
||||
/// This represents a "rotating" histogram which stores two histogram, one which
|
||||
/// should be read and one which should be written to. Every period, the read
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue