Skip to content

Commit 0880c89

Browse files
committed
f Don't pin futures
1 parent c367f71 commit 0880c89

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
beta,
1313
# 1.41.1 is MSRV for Rust-Lightning, lightning-invoice, and lightning-persister
1414
1.41.1,
15-
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
15+
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, lightning-background-processor, and coverage generation
1616
1.45.2,
1717
# 1.47.0 will be the MSRV for no-std builds using hashbrown once core2 is updated
1818
1.47.0]
@@ -48,7 +48,7 @@ jobs:
4848
- toolchain: 1.41.1
4949
build-no-std: false
5050
test-log-variants: true
51-
build-futures: true
51+
build-futures: false
5252
- toolchain: 1.45.2
5353
build-net-old-tokio: true
5454
build-net-tokio: true

lightning-background-processor/Cargo.toml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@ edition = "2018"
1313
all-features = true
1414
rustdoc-args = ["--cfg", "docsrs"]
1515

16+
[features]
17+
futures = [ "futures-util" ]
18+
1619
[dependencies]
1720
bitcoin = "0.29.0"
1821
lightning = { version = "0.0.111", path = "../lightning", features = ["std"] }
1922
lightning-rapid-gossip-sync = { version = "0.0.111", path = "../lightning-rapid-gossip-sync" }
20-
futures = { version = "=0.3.17", optional = true }
21-
futures-core = { version = "=0.3.17", optional = true }
22-
futures-task = { version = "=0.3.17", optional = true }
23-
futures-channel = { version = "=0.3.17", optional = true }
24-
futures-executor = { version = "=0.3.17", optional = true }
25-
futures-io = { version = "=0.3.17", optional = true }
26-
futures-sink = { version = "=0.3.17", optional = true }
27-
futures-util = { version = "=0.3.17", optional = true }
23+
futures-util = { version = "0.3", default-features = false, features = ["async-await-macro"], optional = true }
2824

2925
[dev-dependencies]
3026
lightning = { version = "0.0.111", path = "../lightning", features = ["_test_utils"] }

lightning-background-processor/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use std::time::{Duration, Instant};
3535
use std::ops::Deref;
3636

3737
#[cfg(feature = "futures")]
38-
use futures::{select, future::FutureExt};
38+
use futures_util::{select_biased, future::FutureExt};
3939

4040
/// `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
4141
/// Rust-Lightning running properly, and (2) either can or should be run in the background. Its
@@ -414,7 +414,7 @@ where
414414
let mut should_continue = true;
415415
define_run_body!(persister, event_handler, chain_monitor, channel_manager,
416416
gossip_sync, peer_manager, logger, scorer, should_continue, {
417-
select! {
417+
select_biased! {
418418
_ = channel_manager.get_persistable_update_future().fuse() => true,
419419
cont = sleeper(Duration::from_millis(100)).fuse() => {
420420
should_continue = cont;

lightning-block-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rpc-client = [ "serde", "serde_json", "chunked_transfer" ]
2020
[dependencies]
2121
bitcoin = "0.29.0"
2222
lightning = { version = "0.0.111", path = "../lightning" }
23-
futures = { version = "0.3" }
23+
futures-util = { version = "0.3", default-features = false }
2424
tokio = { version = "1.0", features = [ "io-util", "net", "time" ], optional = true }
2525
serde = { version = "1.0", features = ["derive"], optional = true }
2626
serde_json = { version = "1.0", optional = true }

lightning-block-sync/src/rest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::http::{BinaryResponse, HttpEndpoint, HttpClient, JsonResponse};
77
use bitcoin::hash_types::BlockHash;
88
use bitcoin::hashes::hex::ToHex;
99

10-
use futures::lock::Mutex;
10+
use futures_util::lock::Mutex;
1111

1212
use std::convert::TryFrom;
1313
use std::convert::TryInto;

lightning-block-sync/src/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::http::{HttpClient, HttpEndpoint, HttpError, JsonResponse};
77
use bitcoin::hash_types::BlockHash;
88
use bitcoin::hashes::hex::ToHex;
99

10-
use futures::lock::Mutex;
10+
use futures_util::lock::Mutex;
1111

1212
use serde_json;
1313

0 commit comments

Comments
 (0)