Skip to content

Commit 548a449

Browse files
svix-jplattedrmingdrmer
authored andcommitted
deps: Switch rt crates to use futures-* crates individually
… except rt-compio, which publically re-exports futures.
1 parent bfd11db commit 548a449

9 files changed

Lines changed: 19 additions & 17 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ chrono = { version = "0.4" }
2323
clap = { version = "4.1.11", features = ["derive", "env"] }
2424
derive_more = { version = "2.1.1", features = ["std", "from", "try_into", "display"] }
2525
futures = { version = "0.3" }
26+
futures-channel = { version = "0.3" }
2627
futures-util = { version = "0.3" }
2728
lazy_static = { version = "1.4.0" }
2829
maplit = { version = "1.0.2" }

rt-monoio/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ repository = "https://github.com/databendlabs/openraft"
1717
[dependencies]
1818
openraft-rt = { path = "../rt", version = "0.10.0", features = ["single-threaded"] }
1919

20-
futures = { version = "0.3" }
21-
local-sync = { version = "0.1.1" }
22-
monoio = { version = "0.2.3" }
23-
rand = { version = "0.9" }
24-
tokio = { version = "1.22", features = ["sync"] }
20+
futures-util = { version = "0.3" }
21+
local-sync = { version = "0.1.1" }
22+
monoio = { version = "0.2.3" }
23+
rand = { version = "0.9" }
24+
tokio = { version = "1.22", features = ["sync"] }

rt-monoio/src/mpsc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use std::future::Future;
66

7-
use futures::TryFutureExt;
7+
use futures_util::TryFutureExt;
88
use openraft_rt::Mpsc;
99
use openraft_rt::MpscReceiver;
1010
use openraft_rt::MpscSender;

rt-tokio/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ readme = "README.md"
1313
description = "Tokio runtime implementation for Openraft"
1414

1515
[dependencies]
16-
openraft-rt = { path = "../rt", version = "0.10.0" }
17-
tokio = { version = "1.39", default-features = false, features = ["rt", "rt-multi-thread", "sync", "time"] }
18-
futures = { version = "0.3" }
19-
rand = { version = "0.9", default-features = false, features = ["std", "std_rng"] }
16+
openraft-rt = { path = "../rt", version = "0.10.0" }
17+
tokio = { version = "1.39", default-features = false, features = ["rt", "rt-multi-thread", "sync", "time"] }
18+
futures-util = { version = "0.3" }
19+
rand = { version = "0.9", default-features = false, features = ["std", "std_rng"] }
2020

2121
[features]
2222
default = []

rt-tokio/src/mpsc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::future::Future;
22

3-
use futures::TryFutureExt;
3+
use futures_util::TryFutureExt;
44
use openraft_rt::Mpsc;
55
use openraft_rt::MpscReceiver;
66
use openraft_rt::MpscSender;

rt/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ default = []
1818
single-threaded = ["openraft-macros/single-threaded"]
1919

2020
[dependencies]
21-
futures = { workspace = true }
21+
futures-channel = { workspace = true }
22+
futures-util = { workspace = true }
2223
openraft-macros = { version = "0.10", path = "../macros" }
2324
rand = { workspace = true }

rt/src/async_runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub trait AsyncRuntime: Debug + OptionalSend + OptionalSync + 'static {
148148
F: FnOnce() -> T + Send + 'static,
149149
T: Send + 'static,
150150
{
151-
let (tx, rx) = futures::channel::oneshot::channel();
151+
let (tx, rx) = futures_channel::oneshot::channel();
152152
std::thread::spawn(move || {
153153
tx.send(f()).ok();
154154
});

rt/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod threaded {
5656
use std::future::Future;
5757
use std::pin::Pin;
5858

59-
use futures::Stream;
59+
use futures_util::Stream;
6060

6161
/// A trait that is empty if the `single-threaded` feature flag is enabled,
6262
/// otherwise it extends `Send`.
@@ -90,7 +90,7 @@ mod threaded {
9090
use std::future::Future;
9191
use std::pin::Pin;
9292

93-
use futures::Stream;
93+
use futures_util::Stream;
9494

9595
/// A trait that is empty if the `single-threaded` feature flag is enabled,
9696
/// otherwise it extends `Send`.

rt/src/testing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,8 @@ impl<Rt: AsyncRuntime> Suite<Rt> {
10221022

10231023
/// Polls the future and returns its current state.
10241024
fn poll_in_place<F: Future>(fut: Pin<&mut F>) -> Poll<F::Output> {
1025-
let waker = futures::task::noop_waker();
1026-
let mut cx = futures::task::Context::from_waker(&waker);
1025+
let waker = futures_util::task::noop_waker();
1026+
let mut cx = futures_util::task::Context::from_waker(&waker);
10271027
fut.poll(&mut cx)
10281028
}
10291029

0 commit comments

Comments
 (0)