Skip to content

Commit

Permalink
feat: Update to tokio 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Dec 25, 2020
1 parent 4da3a67 commit 4196019
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions Cargo.toml
Expand Up @@ -31,14 +31,14 @@ url = "2.1"
# We need this for script support
sha1 = { version = ">= 0.2, < 0.7", optional = true }

combine = { version = "4.4", default-features = false, features = ["std"] }
combine = { version = "4.5", default-features = false, features = ["std"] }

# Only needed for AIO
bytes = { version = "0.5", optional = true }
bytes = { version = "1", optional = true }
futures-util = { version = "0.3.0", default-features = false, optional = true }
pin-project-lite = { version = "0.1", optional = true }
tokio-util = { version = "0.4", optional = true }
tokio = { version = "0.3.4", features = ["rt"], optional = true }
pin-project-lite = { version = "0.2", optional = true }
tokio-util = { version = "0.6", optional = true }
tokio = { version = "1", features = ["rt"], optional = true }

# Only needed for the connection manager
arc-swap = { version = "1.1.0", optional = true }
Expand All @@ -48,21 +48,21 @@ futures = { version = "0.3.3", optional = true }
r2d2 = { version = "0.8.8", optional = true }

# Only needed for cluster
crc16 = { version = "0.4.0", optional = true }
rand = { version = "0.7.0", optional = true }
crc16 = { version = "0.4", optional = true }
rand = { version = "0.8", optional = true }
# Only needed for async_std support
async-std = { version = "1.5.0", optional = true}
async-trait = "0.1.24"

# Only needed for TLS
native-tls = { version = "0.2", optional = true }
tokio-native-tls = { version = "0.2", optional = true }
tokio-native-tls = { version = "0.3", optional = true }
async-native-tls = { version = "0.3", optional = true }

[features]
default = ["acl", "streams", "geospatial", "script"]
acl = []
aio = ["bytes", "pin-project-lite", "futures-util", "futures-util/sink", "tokio/io-util", "tokio-util", "tokio-util/codec", "tokio/sync", "combine/tokio-03"]
aio = ["bytes", "pin-project-lite", "futures-util", "futures-util/sink", "tokio/io-util", "tokio-util", "tokio-util/codec", "tokio/sync", "combine/tokio"]
geospatial = []
cluster = ["crc16", "rand"]
script = ["sha1"]
Expand All @@ -76,15 +76,15 @@ streams = []


[dev-dependencies]
rand = "0.7"
rand = "0.8"
net2 = "0.2"
assert_approx_eq = "1.0"
fnv = "1.0.5"
futures = "0.3"
criterion = "0.3"
partial-io = { version = "0.3", features = ["tokio", "quickcheck"] }
quickcheck = "0.6"
tokio = { version = "0.3", features = ["rt", "macros", "rt-multi-thread", "time"] }
tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread", "time"] }
tempdir = "0.3"

[[test]]
Expand Down
6 changes: 3 additions & 3 deletions src/aio.rs
Expand Up @@ -27,7 +27,7 @@ use futures_util::{
future::{Future, FutureExt, TryFutureExt},
ready,
sink::Sink,
stream::{Stream, StreamExt, TryStreamExt as _},
stream::{self, Stream, StreamExt, TryStreamExt as _},
};

use pin_project_lite::pin_project;
Expand Down Expand Up @@ -690,8 +690,8 @@ where
T::Error: ::std::fmt::Debug,
{
const BUFFER_SIZE: usize = 50;
let (sender, receiver) = mpsc::channel(BUFFER_SIZE);
let f = receiver
let (sender, mut receiver) = mpsc::channel(BUFFER_SIZE);
let f = stream::poll_fn(move |cx| receiver.poll_recv(cx))
.map(Ok)
.forward(PipelineSink::new::<SinkItem>(sink_stream))
.map(|_| ());
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Expand Up @@ -214,7 +214,7 @@ mod aio_support {
where
R: AsyncRead + std::marker::Unpin,
{
let result = combine::decode_tokio_03!(*decoder, *read, value(), |input, _| {
let result = combine::decode_tokio!(*decoder, *read, value(), |input, _| {
combine::stream::easy::Stream::from(input)
});
match result {
Expand Down

0 comments on commit 4196019

Please sign in to comment.