MCPcopy Create free account
hub / github.com/ElementsProject/lightning / notification_background_task

Function notification_background_task

plugins/rest-plugin/src/main.rs:265–273  ·  view source on GitHub ↗
(io: SocketIo, mut receiver: Receiver<serde_json::Value>)

Source from the content-addressed store, hash-verified

263}
264
265async fn notification_background_task(io: SocketIo, mut receiver: Receiver<serde_json::Value>) {
266 log::debug!("Background task spawned");
267 while let Some(notification) = receiver.recv().await {
268 match io.emit("message", &notification).await {
269 Ok(_) => (),
270 Err(e) => log::info!("Could not emit notification from background task: {}", e),
271 }
272 }
273}
274
275fn log_error(error: String) {
276 println!(

Callers 1

run_rest_serverFunction · 0.85

Calls 2

emitMethod · 0.80
recvMethod · 0.45

Tested by

no test coverage detected