Skip to main content

Crate fusee_server

Crate fusee_server 

Expand description

Fusee server mode.

The same engine runs as fusee server: the server holds each shard’s log, run store and checkpoints, and workflow code still runs in the application. The application opens an Engine with remote_config; its shard runtimes use remote::RemoteEnv, so each flush is one pipelined round trip to the server plus the server’s own flush.

The server keeps one log for every shard and leases the shards one at a time, each with its own epoch. A worker takes every free shard, or at most max-shards=N of them, and waits as a standby for the rest; when a holder goes away its shards go to waiting workers with higher epochs, which recover them from the server’s disk and resume their workflows. Requests carrying a stale epoch are refused, so a deposed worker can never append again.

Re-exports§

pub use client::Client;
pub use client::ClientStream;
pub use client::serve_calls;
pub use server::Liveness;
pub use server::Server;
pub use server::ServerConfig;

Modules§

client
Calls from other machines in server mode.
foreign
A server connection or elected replica prepared off the host language’s event loop. The foreign shard runtimes themselves stay on that loop.
invoke
Workers invoked over HTTP: suspend to zero.
limits
Step limits in server mode.
proto
The server-mode wire protocol, carried in fusee_core::frame frames.
remote
The worker side of server mode: RemoteEnv is an [Env] whose log, run store and checkpoints live on the server. A shard runtime driven by it behaves exactly as in local mode; a flush is durable once the server flushed it, one pipelined round trip later.
replicated
replicated durability: the log replicated to a quorum.
security
Authentication and TLS for every connection: workers and clients to a server, and replicas to each other.
server
The server: holds the log (one shared log for every shard, or a log per shard in directories from before it), each shard’s run store and checkpoints on its own disk, and leases the shards to worker connections. Each shard is leased on its own, with an epoch of its own: a worker takes free shards up to the number it asked for (all, unless it said otherwise) and waits as a standby for more. When a holder disconnects or goes silent past its Liveness timeout, its shards go to waiting workers with new epochs, which recover them from disk.

Functions§

remote_config
An engine configuration whose storage is the server at addr (host:port, unix:/path/to.sock or replicas://..., optionally followed by connection options such as ?ca=ca.pem&token-file=token; see security::Security::from_options). Blocks until the lease is held.
remote_worker
Like remote_config, also returning the connection, so the worker can serve calls other machines send through the server (client::serve_calls).
remote_worker_with
Like remote_worker, with TLS and the token given as security::Security instead of address options.