projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct async `lightning-background-processor` exit check docs
[rust-lightning]
/
lightning-background-processor
/
src
/
lib.rs
diff --git
a/lightning-background-processor/src/lib.rs
b/lightning-background-processor/src/lib.rs
index 055b5ca6f9937d70cc5b3e76babd9b8778a6b7cc..10bcc9bd6e28dc0cb80c12f25853b160d6be89d6 100644
(file)
--- a/
lightning-background-processor/src/lib.rs
+++ b/
lightning-background-processor/src/lib.rs
@@
-358,8
+358,8
@@
macro_rules! define_run_body {
/// Processes background events in a future.
///
/// `sleeper` should return a future which completes in the given amount of time and returns a
/// Processes background events in a future.
///
/// `sleeper` should return a future which completes in the given amount of time and returns a
-/// boolean indicating whether the background processing should
continue
. Once `sleeper` returns a
-/// future which outputs
fals
e, the loop will exit and this function's future will complete.
+/// boolean indicating whether the background processing should
exit
. Once `sleeper` returns a
+/// future which outputs
tru
e, the loop will exit and this function's future will complete.
///
/// See [`BackgroundProcessor::start`] for information on which actions this handles.
#[cfg(feature = "futures")]
///
/// See [`BackgroundProcessor::start`] for information on which actions this handles.
#[cfg(feature = "futures")]
@@
-411,13
+411,13
@@
where
UMH::Target: 'static + CustomMessageHandler,
PS::Target: 'static + Persister<'a, Signer, CW, T, K, F, L, SC>,
{
UMH::Target: 'static + CustomMessageHandler,
PS::Target: 'static + Persister<'a, Signer, CW, T, K, F, L, SC>,
{
- let mut should_
continue
= true;
+ let mut should_
break
= true;
define_run_body!(persister, event_handler, chain_monitor, channel_manager,
define_run_body!(persister, event_handler, chain_monitor, channel_manager,
- gossip_sync, peer_manager, logger, scorer, should_
continue
, {
+ gossip_sync, peer_manager, logger, scorer, should_
break
, {
select_biased! {
_ = channel_manager.get_persistable_update_future().fuse() => true,
select_biased! {
_ = channel_manager.get_persistable_update_future().fuse() => true,
-
con
t = sleeper(Duration::from_millis(100)).fuse() => {
- should_
continue = con
t;
+
exi
t = sleeper(Duration::from_millis(100)).fuse() => {
+ should_
break = exi
t;
false
}
}
false
}
}
@@
-609,7
+609,7
@@
mod tests {
const EVENT_DEADLINE: u64 = 5 * FRESHNESS_TIMER;
const EVENT_DEADLINE: u64 = 5 * FRESHNESS_TIMER;
- #[derive(Clone,
Eq, Hash, Partial
Eq)]
+ #[derive(Clone,
Hash, PartialEq,
Eq)]
struct TestDescriptor{}
impl SocketDescriptor for TestDescriptor {
fn send_data(&mut self, _data: &[u8], _resume_read: bool) -> usize {
struct TestDescriptor{}
impl SocketDescriptor for TestDescriptor {
fn send_data(&mut self, _data: &[u8], _resume_read: bool) -> usize {