Skip to main content

Module client

Module client 

Expand description

Calls from other machines in server mode.

Workflows run in the worker that holds the server’s lease. Any other process (another service, a webhook handler, an operator’s script) connects as a Client; the server relays its calls to the worker, which runs them against its engine and answers through the server. So a completion token can be finished from anywhere, and updates, queries and signals reach the shard that owns the workflow.

The worker opts in with serve_calls. Arguments and results are JSON.

Structs§

Client
A connection that sends calls to whichever worker holds the shards.
ClientStream
A stream read through a server (Client::stream).
LocalCalls
The protocol calls of a server, answered in its own process: the HTTP API of fusee server --http. Calls go through an in-process client connection, opened again whenever the server closed it (a replica closes its clients on every view change, and every connection while it is not the ready primary). A call that only reads is sent again once if the connection broke under it; any other fails, since the server may have run it.

Functions§

serve_calls
Serves calls other machines send through the server, until the worker’s connection closes. Spawn it next to the engine: