Commit graph

10 commits

Author SHA1 Message Date
Matt Corallo
cf3471f8ad Fix (and test) Future creation after a Notifier was notified
After a `Notifier` has been `notify`'d, attempts to `get_future`
should return a `Future` which is pre-completed, however this was
not the case.

This commit simply fixes the behavior, adding a test to demonstrate
the issue.
2022-10-06 23:54:52 +00:00
Matt Corallo
1beb3bb421 Add a bindings-only version of Future::register_callback
While we could, in theory, add support to the bindings logic to map
`Box<dyn Trait>`, there isn't a whole lot of use doing so when its
incredibly trivial to do directly.

This adds a trivial wrapper around `Future::register_callback` that
is only built in bindings and which is linked in the
`register_callback` docs for visibility.
2022-09-23 21:12:04 +00:00
Matt Corallo
0cc3572719 Fix several compile warnings when testing in no-std mode 2022-09-10 00:18:32 +00:00
Matt Corallo
610511ced6 Fix (really dumb) warning rustc introduced in latest beta 2022-09-09 21:49:05 +00:00
Matt Corallo
f14ea3dd18 Fix several compile warnings added in some of my recent commits 2022-09-09 21:49:05 +00:00
Matt Corallo
2a5bac22bf Add a background processing function that is async.
Adds a method which operates like BackgroundProcessor::start but
instead of functioning by spawning a background thread it is async.
2022-09-06 17:42:24 +00:00
Matt Corallo
c6890cfc33 Add a Future which can receive manager persistence events
This allows users who don't wish to block a full thread to receive
persistence events.

The `Future` added here is really just a trivial list of callbacks,
but from that we can build a (somewhat ineffecient)
std::future::Future implementation and can (at least once a mapping
for Box<dyn Trait> is added) include the future in no-std bindings
as well.

Fixes #1595
2022-09-06 17:42:21 +00:00
Matt Corallo
2035cebe8a Remove internal references to persistence in waker.rs 2022-09-06 16:22:58 +00:00
Matt Corallo
47e9ca15b2 Rename PersistenceNotifier to simply Notifier
... as it is no longer persistence-specific (though still only used
for persistence).
2022-08-12 23:55:28 +00:00
Matt Corallo
68b3d2e453 Move PersistenceNotifier to a new util module
It was always somewhat strange to have a bunch of notification
logic in `channelmanager`, and with the next commit adding a bunch
more, its moved here first.
2022-08-09 06:06:18 +00:00