Skip to main content

run_module

Function run_module 

Source
pub async fn run_module<M, C, F, FE, Fut>(
    socket_path: impl AsRef<Path>,
    module_id: &str,
    module_name: &str,
    version: &str,
    cli_spec: CliSpec,
    rpc_methods: &[&str],
    event_types: Vec<EventType>,
    dispatch: F,
    on_event: FE,
    module: M,
    cli: C,
    db: Arc<dyn Database>,
) -> Result<(), ModuleError>
Expand description

Run a module with automatic connect, registration, event subscription, and dispatch.

Handles the full lifecycle: connect → register CLI/RPC/events → loop (invocations + events) → unload on disconnect.