pub async fn process_events_async<'a, Signer: 'static + Sign, CA: 'static + Deref + Send + Sync, CF: 'static + Deref + Send + Sync, CW: 'static + Deref + Send + Sync, T: 'static + Deref + Send + Sync, K: 'static + Deref + Send + Sync, F: '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, EH: 'static + EventHandler + Send, PS: 'static + Deref + Send, M: 'static + Deref<Target = ChainMonitor<Signer, CF, T, F, L, P>> + Send + Sync, CM: 'static + Deref<Target = ChannelManager<Signer, CW, T, K, F, L>> + Send + Sync, PGS: 'static + Deref<Target = P2PGossipSync<G, CA, 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>> + Send + Sync, S: 'static + Deref<Target = SC> + Send + Sync, SC: WriteableScore<'a>, SleepFuture: Future<Output = bool>, Sleeper: Fn(Duration) -> SleepFuture>(
persister: PS,
event_handler: EH,
chain_monitor: M,
channel_manager: CM,
gossip_sync: GossipSync<PGS, RGS, G, CA, L>,
peer_manager: PM,
logger: L,
scorer: Option<S>,
sleeper: Sleeper
) -> Result<(), Error>where
CA::Target: 'static + Access,
CF::Target: 'static + Filter,
CW::Target: 'static + Watch<Signer>,
T::Target: 'static + BroadcasterInterface,
K::Target: 'static + KeysInterface<Signer = Signer>,
F::Target: 'static + FeeEstimator,
L::Target: 'static + Logger,
P::Target: 'static + Persist<Signer>,
CMH::Target: 'static + ChannelMessageHandler,
OMH::Target: 'static + OnionMessageHandler,
RMH::Target: 'static + RoutingMessageHandler,
UMH::Target: 'static + CustomMessageHandler,
PS::Target: 'static + Persister<'a, Signer, CW, T, K, F, 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 continue. Once sleeper
returns a
future which outputs false, the loop will exit and this function’s future will complete.
See BackgroundProcessor::start
for information on which actions this handles.