Skip to main content

Module runner

Module runner 

Source
Expand description

Module runner and invocation context.

Provides InvocationContext for CLI/RPC handlers, run_async for sync-over-async CLI, and run_module for the unified connect/dispatch/loop lifecycle.

Structs§

InvocationContext
Context passed to CLI handlers for database and config access.

Functions§

run_async
Run an async future from a sync context (e.g. CLI handler). Blocks the current thread and executes the future on the current runtime. Use when #[command] methods need to call async APIs.
run_module
Run a module with automatic connect, registration, event subscription, and dispatch.
run_module_with_setup
Run a module where (module, cli) are created after connect.
run_module_with_tick
Run a module with optional on_connect (setup) and on_tick (periodic) callbacks.