Skip to content

Commit

Permalink
Update the rest of the crates and upgrade ready cache to `std::f… (#379)
Browse files Browse the repository at this point in the history
* Update hedge, filter, load, load-shed, and more

* Update ready cache

* Prepare release for ready-cache

* fix merge

* Update balance

* Prepare balance release
  • Loading branch information
LucioFranco authored Dec 5, 2019
1 parent 0d2a377 commit e2f1a49
Show file tree
Hide file tree
Showing 45 changed files with 803 additions and 1,005 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

members = [
"tower",
# "tower-balance",
"tower-balance",
"tower-buffer",
# "tower-discover",
# "tower-filter",
# "tower-hedge",
"tower-discover",
"tower-filter",
"tower-hedge",
"tower-layer",
"tower-limit",
# "tower-load",
# "tower-load-shed",
# "tower-ready-cache",
"tower-load",
"tower-load-shed",
"tower-ready-cache",
"tower-reconnect",
"tower-retry",
"tower-service",
# "tower-spawn-ready",
"tower-spawn-ready",
"tower-test",
"tower-timeout",
"tower-make",
Expand Down
6 changes: 6 additions & 0 deletions tower-balance/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 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`
Expand Down
35 changes: 17 additions & 18 deletions tower-balance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ name = "tower-balance"
# - README.md
# - Update CHANGELOG.md.
# - Create "v0.1.x" git tag.
version = "0.3.0-alpha.2"
version = "0.3.0"
authors = ["Tower Maintainers <[email protected]>"]
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-alpha.2"
documentation = "https://docs.rs/tower-balance/0.3.0"
description = """
Balance load across a set of uniform services.
"""
Expand All @@ -26,29 +26,28 @@ log = ["tracing/log"]
default = ["log"]

[dependencies]
futures-util-preview = "=0.3.0-alpha.19"
futures-core-preview = "=0.3.0-alpha.19"
futures-util = "0.3"
futures-core = "0.3"
pin-project = "0.4"
indexmap = "1.0.2"
tracing = "0.1"
rand = "0.6.5"
tokio-sync = "=0.2.0-alpha.6"
tokio-timer = "=0.3.0-alpha.6"
tower-discover = { version = "=0.3.0-alpha.2", path = "../tower-discover" }
tower-layer = { version = "=0.3.0-alpha.2", path = "../tower-layer" }
tower-load = { version = "=0.3.0-alpha.2", path = "../tower-load" }
tower-service = { version = "=0.3.0-alpha.2", path = "../tower-service" }
tower-make = { version = "=0.3.0-alpha.2a", path = "../tower-make" }
tokio = { version = "0.2", features = ["sync", "time"] }
tower-discover = { version = "0.3", path = "../tower-discover" }
tower-layer = { version = "0.3", path = "../tower-layer" }
tower-load = { version = "0.3", path = "../tower-load" }
tower-service = { version = "0.3", path = "../tower-service" }
tower-ready-cache = { version = "0.3", path = "../tower-ready-cache" }
tower-make = { version = "0.3", path = "../tower-make" }
slab = "0.4"

[dev-dependencies]
tracing-subscriber = "0.1.1"
hdrhistogram = "6.0"
quickcheck = { version = "0.6", default-features = false }
tokio = "=0.2.0-alpha.6"
tokio-executor = "=0.2.0-alpha.6"
tokio-test = "=0.2.0-alpha.6"
tower-buffer = { version = "=0.3.0-alpha.2", path = "../tower-buffer" }
tower-limit = { version = "=0.3.0-alpha.2", path = "../tower-limit" }
tower-test = { version = "=0.3.0-alpha.2", path = "../tower-test" }
tower = { version = "=0.3.0-alpha.2", path = "../tower" }
tokio = { version = "0.2", features = ["macros"] }
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" }
10 changes: 5 additions & 5 deletions tower-balance/examples/demo.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//! Exercises load balancers with mocked services.
use futures_core::TryStream;
use futures_util::{stream, stream::StreamExt, try_stream::TryStreamExt};
use futures_util::{stream, stream::StreamExt, stream::TryStreamExt};
use hdrhistogram::Histogram;
use pin_project::pin_project;
use rand::{self, Rng};
use std::time::{Duration, Instant};
use std::time::Duration;
use std::{
pin::Pin,
task::{Context, Poll},
};
use tokio::timer;
use tokio::time::{self, Instant};
use tower::util::ServiceExt;
use tower_balance as lb;
use tower_discover::{Change, Discover};
Expand Down Expand Up @@ -116,7 +116,7 @@ fn gen_disco() -> impl Discover<
let latency = Duration::from_millis(rand::thread_rng().gen_range(0, maxms));

async move {
timer::delay(start + latency).await;
time::delay_until(start + latency).await;
let latency = start.elapsed();
Ok(Rsp { latency, instance })
}
Expand All @@ -140,7 +140,7 @@ where
{
println!("{}", name);

let requests = stream::repeat(Req).take(REQUESTS as u64);
let requests = stream::repeat(Req).take(REQUESTS);
let service = ConcurrencyLimit::new(lb, CONCURRENCY);
let responses = service.call_all(requests).unordered();

Expand Down
2 changes: 1 addition & 1 deletion tower-balance/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Load balancing middlewares.
#![doc(html_root_url = "https://docs.rs/tower-balance/0.3.0-alpha.2")]
#![doc(html_root_url = "https://docs.rs/tower-balance/0.3.0")]
#![warn(
missing_debug_implementations,
missing_docs,
Expand Down
2 changes: 1 addition & 1 deletion tower-balance/src/p2c/layer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::BalanceMake;
use rand::{rngs::SmallRng, Rng, SeedableRng};
use rand::{rngs::SmallRng, FromEntropy, Rng, SeedableRng};
use std::{fmt, marker::PhantomData};
use tower_layer::Layer;

Expand Down
2 changes: 2 additions & 0 deletions tower-balance/src/p2c/make.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::Balance;
use crate::error;
use futures_core::ready;
use pin_project::pin_project;
use rand::{rngs::SmallRng, FromEntropy};
Expand Down Expand Up @@ -73,6 +74,7 @@ where
F: Future<Output = Result<T, E>>,
T: Discover,
<T as Discover>::Service: Service<Req>,
<<T as Discover>::Service as Service<Req>>::Error: Into<error::Error>,
{
type Output = Result<Balance<T, Req>, E>;

Expand Down
Loading

0 comments on commit e2f1a49

Please sign in to comment.