pub struct RiftServer {
pub config: ServerConfig,
/* private fields */
}Expand description
The Rift/1 server.
This is the top-level entry point. It holds the broker, auth provider, metrics, and (in standalone mode) the transport factory. Each accepted connection is assigned a unique connection id and spawned as a new tokio task running the full Rift protocol lifecycle.
Fields§
§config: ServerConfigServer configuration (heartbeat, payload limits, topic defaults, etc.).
Implementations§
Source§impl RiftServer
impl RiftServer
Sourcepub fn builder() -> RiftServerBuilder
pub fn builder() -> RiftServerBuilder
Create a new RiftServerBuilder.
Sourcepub async fn run(&self, addr: SocketAddr, shutdown: Arc<Notify>) -> Result<()>
pub async fn run(&self, addr: SocketAddr, shutdown: Arc<Notify>) -> Result<()>
Bind and run the server in standalone mode, blocking until
shutdown is notified.
Requires feature websocket and a transport set on the builder
(call builder.websocket_transport() before build()).
Each accepted connection is spawned as a new tokio task. The method returns when the shutdown notifier fires or when the listener encounters a fatal error.
Sourcepub fn accept_and_spawn(&self, transport: Box<dyn TransportConnection>)
pub fn accept_and_spawn(&self, transport: Box<dyn TransportConnection>)
Accept a single transport connection and spawn the Rift protocol handler onto the tokio runtime.
This is the entry point for framework integrations (axum, actix-web,
warp, ntex). The caller obtains a Box<dyn TransportConnection> from
the framework adapter and passes it here. The server assigns a unique
connection id, creates a Connection, and spawns it as a new task.