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

Function handle_notification

plugins/rest-plugin/src/handlers.rs:389–403  ·  view source on GitHub ↗
(
    plugin: Plugin<PluginState>,
    value: serde_json::Value,
)

Source from the content-addressed store, hash-verified

387}
388
389pub async fn handle_notification(
390 plugin: Plugin<PluginState>,
391 value: serde_json::Value,
392) -> Result<(), anyhow::Error> {
393 if let Some(sht) = value.get("shutdown") {
394 log::info!("Got shutdown notification: {}", sht);
395 /* This seems to error when subscribing to "*" notifications */
396 _ = plugin.shutdown();
397 process::exit(0);
398 }
399 match plugin.state().notification_sender.send(value).await {
400 Ok(()) => Ok(()),
401 Err(e) => Err(anyhow!("Error sending notification: {}", e)),
402 }
403}
404
405pub async fn swagger_redirect_middleware(
406 Extension(swagger_path): Extension<String>,

Callers

nothing calls this directly

Calls 4

stateMethod · 0.80
getMethod · 0.45
shutdownMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected