pub async fn process_events_async<'a, UL: 'static + Deref + Send + Sync, CF: 'static + Deref + Send + Sync, CW: 'static + Deref + Send + Sync, T: 'static + Deref + Send + Sync, ES: 'static + Deref + Send + Sync, NS: 'static + Deref + Send + Sync, SP: 'static + Deref + Send + Sync, F: 'static + Deref + Send + Sync, R: 'static + Deref + Send + Sync, G: 'static + Deref<Target = NetworkGraph<L>> + Send + Sync, L: 'static + Deref + Send + Sync, P: 'static + Deref + Send + Sync, Descriptor: 'static + SocketDescriptor + Send + Sync, CMH: 'static + Deref + Send + Sync, RMH: 'static + Deref + Send + Sync, OMH: 'static + Deref + Send + Sync, EventHandlerFuture: Future<Output = ()>, EventHandler: Fn(Event) -> EventHandlerFuture, PS: 'static + Deref + Send, M: 'static + Deref<Target = ChainMonitor<<SP::Target as SignerProvider>::Signer, CF, T, F, L, P>> + Send + Sync, CM: 'static + Deref<Target = ChannelManager<CW, T, ES, NS, SP, F, R, L>> + Send + Sync, PGS: 'static + Deref<Target = P2PGossipSync<G, UL, L>> + Send + Sync, RGS: 'static + Deref<Target = RapidGossipSync<G, L>> + Send, UMH: 'static + Deref + Send + Sync, PM: 'static + Deref<Target = PeerManager<Descriptor, CMH, RMH, OMH, L, UMH, NS>> + Send + Sync, S: 'static + Deref<Target = SC> + Send + Sync, SC: for<'b> WriteableScore<'b>, SleepFuture: Future<Output = bool> + Unpin, Sleeper: Fn(Duration) -> SleepFuture>(
persister: PS,
event_handler: EventHandler,
chain_monitor: M,
channel_manager: CM,
gossip_sync: GossipSync<PGS, RGS, G, UL, L>,
peer_manager: PM,
logger: L,
scorer: Option<S>,
sleeper: Sleeper
) -> Result<(), Error>where
UL::Target: 'static + UtxoLookup,
CF::Target: 'static + Filter,
CW::Target: 'static + Watch<<SP::Target as SignerProvider>::Signer>,
T::Target: 'static + BroadcasterInterface,
ES::Target: 'static + EntropySource,
NS::Target: 'static + NodeSigner,
SP::Target: 'static + SignerProvider,
F::Target: 'static + FeeEstimator,
R::Target: 'static + Router,
L::Target: 'static + Logger,
P::Target: 'static + Persist<<SP::Target as SignerProvider>::Signer>,
CMH::Target: 'static + ChannelMessageHandler,
OMH::Target: 'static + OnionMessageHandler,
RMH::Target: 'static + RoutingMessageHandler,
UMH::Target: 'static + CustomMessageHandler,
PS::Target: 'static + Persister<'a, CW, T, ES, NS, SP, F, R, L, SC>,
Available on crate feature
futures
only.Expand description
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 exit. Once sleeper
returns a
future which outputs true, the loop will exit and this function’s future will complete.
See BackgroundProcessor::start
for information on which actions this handles.
Requires the futures
feature. Note that while this method is available without the std
feature, doing so will skip calling NetworkGraph::remove_stale_channels_and_tracking
,
you should call NetworkGraph::remove_stale_channels_and_tracking_with_time
regularly
manually instead.