pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn new(config: ServerConfig, view_index: ViewIndex) -> Self
pub fn with_spec(self, spec: Spec) -> Result<Self>
pub fn with_materialized_views(self, registry: MaterializedViewRegistry) -> Self
pub fn with_websocket_auth_plugin( self, websocket_auth_plugin: Arc<dyn WebSocketAuthPlugin>, ) -> Self
pub fn with_http_auth_plugin( self, http_auth_plugin: Arc<dyn WebSocketAuthPlugin>, ) -> Self
pub fn with_websocket_usage_emitter( self, websocket_usage_emitter: Arc<dyn WebSocketUsageEmitter>, ) -> Self
pub fn with_websocket_max_clients(self, websocket_max_clients: usize) -> Self
Sourcepub fn with_websocket_rate_limit_config(self, config: RateLimitConfig) -> Self
pub fn with_websocket_rate_limit_config(self, config: RateLimitConfig) -> Self
Configure rate limiting for WebSocket connections.
This sets global rate limits such as maximum connections per IP, timeouts, and rate windows. Per-subject limits are controlled via AuthContext.Limits from the authentication token.
Sourcepub fn plan(&self) -> RuntimePlan
pub fn plan(&self) -> RuntimePlan
Return the immutable capability plan selected by the builder.
Sourcepub async fn run(self) -> Result<()>
pub async fn run(self) -> Result<()>
Start everything and block until a shutdown signal, then stop cleanly.
This is spawn followed by waiting for SIGINT/SIGTERM
(or for a core task to exit) and RuntimeHandle::shutdown. Callers
that embed the server in a larger process should use spawn directly
and decide for themselves when to stop.
Sourcepub async fn spawn(self) -> Result<RuntimeHandle>
pub async fn spawn(self) -> Result<RuntimeHandle>
Start the runtime’s tasks and return a handle that owns them.
Everything run starts is started here: projector, parser, snapshot
manager, bus cleanup, stats, and - only when configured - the WebSocket
listener and the HTTP health server. Nothing here installs signal
handlers or blocks; the handle is how the caller waits, serves
connections it accepted itself, and shuts the runtime down.
A handle owns its runtime’s channel, buses, cache and snapshot state outright; nothing is shared through process globals, so a test or an application can start and stop runtimes independently.