Skip to main content

Module subsystems

Module subsystems 

Source
Expand description

Server subsystem assembly and lifecycle management.

ServerSubsystems bundles the three optional platform extensions — object storage, serverless functions, and realtime entity streams — into a single coherent struct that the server can query, route-mount, and shut down in a controlled order.

§Assembly

Use builder::ServerSubsystemsBuilder to assemble subsystems from their pre-built parts. The builder validates cross-subsystem dependencies before returning the final ServerSubsystems:

ⓘ
let subsystems = ServerSubsystemsBuilder::new()
    .with_storage(storage_subsystem)
    .with_functions(functions_subsystem)
    .with_realtime(realtime_subsystem)
    .build()?;

§Shutdown order

Shutdown proceeds in reverse initialization order:

  1. Stop the cron scheduler (functions)
  2. Drain the realtime event channel
  3. Drop the realtime server (closes all WebSocket connections)
  4. Drop the functions observer (stops dispatching events)
  5. Drop the storage backend (flushes any pending writes)

Re-exports§

pub use builder::ServerSubsystemsBuilder;
pub use builder::SubsystemBuildError;
pub use validator::SubsystemConfigWarning;
pub use validator::validate_subsystems_config;

Modules§

builder
Builder for assembling server subsystems with cross-subsystem validation.
validator
Cross-subsystem configuration validation and startup warnings.

Structs§

BeforeMutationHooks
Shared bundle of before-mutation state passed into AppState for handler access.
FunctionsSubsystem
Functions subsystem: observer and trigger registry.
RealtimeSubsystem
Realtime subsystem: WebSocket broadcast server and event observer.
ServerSubsystems
All optional platform subsystems assembled from the compiled schema.
StorageSubsystem
Storage subsystem: backend, metadata repository, RLS evaluator, and bucket config.