Skip to main content

dispatch_session_event_from_cell

Function dispatch_session_event_from_cell 

Source
pub async fn dispatch_session_event_from_cell(
    extension_session: &ExtensionSessionCell,
    tag: EventTag,
) -> Option<String>
Expand description

Dispatch a no-payload lifecycle event using the live extension-session cell.

This is the cell-based counterpart to dispatch_session_event_async. It lets headless RPC tasks retain the live session without borrowing the larger ReloadContext. The snapshot and keepalive are cloned before awaiting, so a concurrent /reload neither invalidates the plugin function pointers mid-dispatch nor keeps a swapped-out registry alive.

Each handler runs on a blocking thread with a per-event timeout ([rpi_extensions::lifecycle_timeout_for]); a handler returning rpi_plugin_sdk::EVENT_HANDLER_ABORT is reported as Some(reason). Returns None when no plugins are loaded, no handler subscribes, or the registry is stale (a /reload swapped the session out).