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:
- Stop the cron scheduler (functions)
- Drain the realtime event channel
- Drop the realtime server (closes all
WebSocketconnections) - Drop the functions observer (stops dispatching events)
- 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§
- Before
Mutation Hooks - Shared bundle of before-mutation state passed into
AppStatefor handler access. - Functions
Subsystem - Functions subsystem: observer and trigger registry.
- Realtime
Subsystem - Realtime subsystem:
WebSocketbroadcast server and event observer. - Server
Subsystems - All optional platform subsystems assembled from the compiled schema.
- Storage
Subsystem - Storage subsystem: backend, metadata repository, RLS evaluator, and bucket config.