-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the user-provided SleepFuture
for interval checks in background-processor
#1962
Use the user-provided SleepFuture
for interval checks in background-processor
#1962
Conversation
`background-processor` does a number of jobs on various timers. Currently, those are all done by checking the timers every 100ms by interrogating `std::time::Instant`. This is fine for the threaded version, but we'd like more flexibility in the `futures`- based `background-processor`. Here we swap the `std::time::Instant` interrogation for a lambda which we will switch out to the user-provided sleeper in the next commit.
`background-processor` does a number of jobs on various timers. Instead of doing those by interrogating `std::time::Instant`, this change swaps to using the existing user-provided sleep future. Fixes lightningdevkit#1864.
Codecov ReportBase: 90.72% // Head: 90.75% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1962 +/- ##
==========================================
+ Coverage 90.72% 90.75% +0.03%
==========================================
Files 97 97
Lines 50579 51341 +762
Branches 50579 51341 +762
==========================================
+ Hits 45888 46595 +707
- Misses 4691 4746 +55
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
LGTM after squash. |
This makes `background-processor` build without `std` at all. This isn't particularly useful in the general no-std case as `background-processor` is only useful with the `futures` feature, and async will generally need `std` in some way or another. Still, it ensures we don't end up reintroducing a dependency on the current time, which breaks `wasm` use-cases.
1540f5e
to
aa4c6f6
Compare
background-processor
does a number of jobs on various timers.Currently, those are all done by checking the timers every 100ms
by interrogating
std::time::Instant
. This is fine for thethreaded version, but we'd like more flexibility in the
futures
-based
background-processor
.Here we swap the
std::time::Instant
interrogation for a lambdawhich we will switch out to the user-provided sleeper for the async futures version.
Fixes #1864.