@@ -1400,6 +1400,10 @@ pub trait OnionMessageProvider {
1400
1400
///
1401
1401
/// Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
1402
1402
///
1403
+ /// Implementations of this trait may also feature an async version of event handling, as shown with
1404
+ /// [`ChannelManager::process_pending_events_async`] and
1405
+ /// [`ChainMonitor::process_pending_events_async`].
1406
+ ///
1403
1407
/// # Requirements
1404
1408
///
1405
1409
/// When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
@@ -1426,6 +1430,8 @@ pub trait OnionMessageProvider {
1426
1430
/// [`handle_event`]: EventHandler::handle_event
1427
1431
/// [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
1428
1432
/// [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
1433
+ /// [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
1434
+ /// [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
1429
1435
pub trait EventsProvider {
1430
1436
/// Processes any events generated since the last call using the given event handler.
1431
1437
///
@@ -1434,6 +1440,10 @@ pub trait EventsProvider {
1434
1440
}
1435
1441
1436
1442
/// A trait implemented for objects handling events from [`EventsProvider`].
1443
+ ///
1444
+ /// An async variation also exists for implementations of [`EventsProvider`] that support async
1445
+ /// event handling. The async event handler should satisfy the generic bounds: `F:
1446
+ /// core::future::Future, H: Fn(Event) -> F`.
1437
1447
pub trait EventHandler {
1438
1448
/// Handles the given [`Event`].
1439
1449
///
0 commit comments