step 1: move all things to where they're going

Note that this also moves all crates from `log` to `tracing`.
It also does not set any dependencies as optional.
This commit is contained in:
Jon Gjengset 2020-03-31 13:10:47 -04:00
parent 0f9eb648a5
commit 8df2a3e410
No known key found for this signature in database
GPG Key ID: 3CB1EC545A706318
175 changed files with 245 additions and 1598 deletions

View File

@ -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",
]

View File

@ -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

View File

@ -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" }

View File

@ -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.

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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"] }

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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"

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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"] }

View File

@ -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.

View File

@ -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.

View File

@ -1,3 +0,0 @@
# 0.3.0 (December 4, 2019)
- Initial release

View File

@ -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"] }

View File

View File

@ -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

View File

@ -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"] }

View File

@ -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.

View File

@ -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.

View File

@ -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},
};

View File

@ -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

View File

@ -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"] }

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 }

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 }

View File

@ -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.

View File

@ -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.

View File

@ -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> {}
}

View File

@ -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.

View File

@ -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"

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -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"

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 }

View File

@ -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.

View File

@ -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.

View File

@ -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)

View File

@ -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"] }

View File

@ -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.

View File

@ -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.

View File

@ -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>;

View File

@ -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

View File

@ -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"

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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" }

View File

@ -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.

View File

@ -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.

View File

@ -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).

View File

@ -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,44 @@ 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"]
buffer = []
discover = []
filter = []
hedge = ["filter"]
limit = []
load = ["discover"]
load-shed = []
make = []
ready-cache = []
reconnect = ["make"]
retry = []
spawn-ready = []
timeout = []
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"
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
hdrhistogram = "6.0"
indexmap = "1.0.2"
pin-project = "0.4"
rand = { version = "0.7", features = ["small_rng"] }
slab = "0.4"
tokio = { version = "0.2", features = ["rt-core", "sync", "time"] }
tower-layer = { version = "0.3", path = "../tower-layer" }
tower-service = { version = "0.3", path = "../tower-service" }
tracing = "0.1.2"
[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"

5
tower/src/balance/mod.rs Normal file
View File

@ -0,0 +1,5 @@
//! Load balancing middlewares.
pub mod error;
pub mod p2c;
pub mod pool;

View File

@ -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.

View File

@ -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};

View File

@ -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)]

View File

@ -1,6 +1,6 @@
//! Future types
use crate::{
use super::{
error::{Closed, Error},
message,
};

View File

@ -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;

View File

@ -1,4 +1,4 @@
use crate::error::ServiceError;
use super::error::ServiceError;
use tokio::sync::oneshot;
/// Message sent over buffer

View File

@ -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;

View File

@ -1,4 +1,4 @@
use crate::{
use super::{
error::Error,
future::ResponseFuture,
message::Message,

View File

@ -1,4 +1,4 @@
use crate::{
use super::{
error::{Closed, Error, ServiceError},
message::Message,
};

View File

@ -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.
///
@ -125,8 +117,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 +130,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 +146,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 +166,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.

View File

@ -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::{

View File

@ -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;

View File

@ -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;

View File

@ -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::{

View File

@ -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.

View File

@ -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;

View File

@ -1,4 +1,4 @@
use crate::error::Error;
use super::error::Error;
use std::future::Future;
/// Checks a request

View File

@ -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 {

View File

@ -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

View File

@ -1,38 +1,53 @@
#![doc(html_root_url = "https://docs.rs/tower/0.3.1")]
// Allows refining features in the future without breaking backwards
// compatibility
#![cfg(feature = "full")]
#![warn(
missing_debug_implementations,
missing_docs,
rust_2018_idioms,
unreachable_pub
)]
#![allow(elided_lifetimes_in_paths)]
//! `fn(Request) -> Future<Response>`
//!
//! Tower is a library of modular and reusable components for building
//! robust networking clients and servers.
#[doc(inline)]
pub use tower_buffer as buffer;
#[doc(inline)]
pub use tower_discover as discover;
#[doc(inline)]
pub use tower_limit as limit;
#[doc(inline)]
pub use tower_load_shed as load_shed;
#[doc(inline)]
pub use tower_retry as retry;
#[doc(inline)]
pub use tower_timeout as timeout;
// pub use tower_layer as layer;
#[doc(inline)]
pub use tower_layer as layer;
pub mod builder;
#[cfg(feature = "balance")]
pub mod balance;
#[cfg(feature = "buffer")]
pub mod buffer;
#[cfg(feature = "discover")]
pub mod discover;
#[cfg(feature = "filter")]
#[allow(unreachable_pub)]
pub(crate) mod filter;
#[cfg(feature = "hedge")]
#[allow(unreachable_pub)]
pub(crate) mod hedge;
#[cfg(feature = "limit")]
pub mod limit;
#[cfg(feature = "load")]
pub mod load;
#[cfg(feature = "load-shed")]
pub mod load_shed;
#[cfg(feature = "make")]
pub mod make;
#[cfg(feature = "ready-cache")]
pub mod ready_cache;
#[cfg(feature = "reconnect")]
pub mod reconnect;
#[cfg(feature = "retry")]
pub mod retry;
#[cfg(feature = "spawn-ready")]
pub mod spawn_ready;
#[cfg(feature = "timeout")]
pub mod timeout;
#[cfg(feature = "util")]
pub mod util;
pub use crate::{builder::ServiceBuilder, util::ServiceExt};
pub mod builder;
#[cfg(feature = "util")]
pub use self::util::{service_fn, ServiceExt};
pub use crate::builder::ServiceBuilder;
pub use tower_service::Service;
pub use tower_util::service_fn;

Some files were not shown because too many files have changed in this diff Show More