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::frameframes. - remote
- The worker side of server mode:
RemoteEnvis 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
replicateddurability: 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
Livenesstimeout, 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.sockorreplicas://..., optionally followed by connection options such as?ca=ca.pem&token-file=token; seesecurity::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 assecurity::Securityinstead of address options.