Expand description
sapphire-sync’s app server: what sapphire-sync serve runs, in either
edition. A library, not a binary of its own: the server is set up with the
same sapphire-sync command that runs it (sapphire-sync-cli), so there is
no separate server command to tell from the client’s.
Two builders, bridge-less for one-shot verbs and sync-mounted for serve,
because the bridge connection belongs to the serve path only
(the review of 0acb194 ruled the one-shot verbs bridge-less):
build_oneshothands every one-shot framework verb that needs a server (service,update) a bareAppServer—dispatchneeds only the app name and the service spec, and a CLI invocation must not open a bridge or fail with a bridge error. Astatuson a host without a server answers the framework’s “no sapphire-sync server is running” and exits 1; aworkspace initlikewise reports the absent server. Neither touches the bridge.build_serveadditionally mounts aSyncRuntimethat reaches the bridge itself (the daemon is always service-managed) withAppServer::sync, plus the app’s own status rows withAppServer::status_rows: one row per synced workspace, rendered per report from the live runtime. The runtime is connect-only — nothing starts a bridge on demand (the framework’s global constraint) — and the framework connects when the server runs, and again whenever the bridge restarts (sapphire-framework#244).serveon a host whose bridge is not running yet serves without sync until it is; meanwhilesync.*answers “not connected to sapphire-bridge”. A bridge of another API version still stops the start.servecalls it once per round ofserve_restarting, so aserver.restartgets a fresh runtime.
The IPC endpoint, the stop channel and the signals are run()’s business
in both paths; the app installs nothing there.
ManagedBy is the transport’s, which SyncRuntime takes.
Enums§
- Edition
- Which edition runs the server: the release file
updateinstalls is the edition’s own.
Constants§
- VERSION
- The version the server reports, and the command line’s clients name: the editions and this library share it (release-plz.toml).
Functions§
- build_
oneshot - The app’s server for one-shot verbs: an
AppServerwith nothing mounted. - build_
serve - The app’s embedded server: sync runtime,
AppServer. - status_
rows - The status rows the app’s server reports, for the framework’s
AppServer::status_rows.