tower-util: reduce dependencies, make call-all optional

This commit is contained in:
Sean McArthur 2019-12-11 09:53:19 -08:00
parent 1843416dfe
commit f130e5e113
7 changed files with 18 additions and 9 deletions

View File

@ -22,14 +22,20 @@ Utilities for working with `Service`.
categories = ["asynchronous", "network-programming"]
edition = "2018"
[features]
call-all = ["futures-util"]
[dependencies]
tower-service = "0.3"
pin-project = "0.4"
futures-util = "0.3"
futures-core = "0.3"
futures-core = { version = "0.3", default-features = false }
# Optional
futures-util = { version = "0.3", optional = true, default-features = false }
[dev-dependencies]
tokio-test = "0.2"
tokio = { version = "0.2", features = ["stream", "sync", "macros"] }
tokio = { version = "0.2", features = ["stream", "sync", "macros"] }
tower = { version = "0.3", path = "../tower" }
tower-test = { version = "0.3", path = "../tower-test" }

View File

@ -2,7 +2,7 @@
//!
//! See `Either` documentation for more details.
use futures_util::ready;
use futures_core::ready;
use pin_project::{pin_project, project};
use std::{
future::Future,

View File

@ -10,6 +10,7 @@
//! Various utility types and functions that are generally with Tower.
mod boxed;
#[cfg(feature = "call-all")]
mod call_all;
mod either;
mod oneshot;
@ -20,7 +21,6 @@ mod service_fn;
pub use crate::{
boxed::{BoxService, UnsyncBoxService},
call_all::{CallAll, CallAllUnordered},
either::Either,
oneshot::Oneshot,
optional::Optional,
@ -28,6 +28,9 @@ pub use crate::{
service_fn::{service_fn, ServiceFn},
};
#[cfg(feature = "call-all")]
pub use crate::call_all::{CallAll, CallAllUnordered};
pub mod error {
//! Error types

View File

@ -1,4 +1,4 @@
use futures_util::ready;
use futures_core::ready;
use pin_project::{pin_project, project};
use std::{
fmt,

View File

@ -1,5 +1,5 @@
use super::{error, Error};
use futures_util::ready;
use futures_core::ready;
use pin_project::pin_project;
use std::{
future::Future,

View File

@ -1,6 +1,6 @@
use std::{fmt, marker::PhantomData};
use futures_util::ready;
use futures_core::ready;
use std::{
future::Future,
pin::Pin,

View File

@ -36,7 +36,7 @@ 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" }
tower-util = { version = "0.3", path = "../tower-util", features = ["call-all"] }
futures-core = "0.3"
[dev-dependencies]