morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::backend::ServerConfig Struct Reference

Everything about a RemoteServer that is configured rather than learned: given once, at construction, and never changed. More...

#include <remote.hpp>

Public Attributes

LimitPolicy limits {}
 Opt-in resource limits. Default-constructed: unbounded.
LogProvider logProvider
 Consulted whenever an instance is constructed with a non-empty contextKey — every register envelope, and every attach that misses the shared directory and therefore creates the instance.
std::function< void(const HealthStatus &)> healthHandler
 Called with the server's health: once from the constructor, and again, on the server's strand, whenever readiness changes (beginShutdown()). Null: nothing is called.
std::uint32_t minProtocolVersion = ::morph::wire::kProtocolVersion
 Oldest protocol version this server accepts in reply to "hello". Must not exceed maxProtocolVersion.
std::uint32_t maxProtocolVersion = ::morph::wire::kProtocolVersion
 Newest protocol version this server accepts in reply to "hello". Widen the range when a kProtocolVersion bump must keep serving older clients through their deprecation window (see docs/spec/core/wire.md, "Action-evolution policy").
PayloadCompleteness payloadCompleteness = PayloadCompleteness::Lenient
 Whether an execute body must carry every field the action's served schema marks required. See PayloadCompleteness for why Lenient is the default.
std::vector< std::shared_ptr< IEnvelopeService > > services
 Extensions that answer envelope kinds the server does not know itself, consulted in order. Empty: none, and every unknown kind is answered err "unknown envelope kind: <kind>". A null entry is refused by the constructor.
std::chrono::milliseconds coalesceWindow {50}
 How long a connection's changes are merged before they are sent as one changes event.

Detailed Description

Everything about a RemoteServer that is configured rather than learned: given once, at construction, and never changed.

The server reads these fields on its own strand and on its models' strands without a lock, which is sound only because nothing writes them after the constructor. A deployment that wants different limits constructs a different server. See docs/spec/core/backend.md, "`ServerConfig`".

Definition at line 289 of file remote.hpp.

Member Data Documentation

◆ limits

LimitPolicy morph::backend::ServerConfig::limits {}

Opt-in resource limits. Default-constructed: unbounded.

Definition at line 291 of file remote.hpp.

◆ logProvider

LogProvider morph::backend::ServerConfig::logProvider

Consulted whenever an instance is constructed with a non-empty contextKey — every register envelope, and every attach that misses the shared directory and therefore creates the instance.

RemoteServer owns the model instances of every remote client, so it is the only place that can attach an action log to them. Null: no instance gets a log. Runs on the server's strand.

Definition at line 300 of file remote.hpp.

◆ healthHandler

std::function<void(const HealthStatus&)> morph::backend::ServerConfig::healthHandler

Called with the server's health: once from the constructor, and again, on the server's strand, whenever readiness changes (beginShutdown()). Null: nothing is called.

A deployment's transport can expose it over a probe endpoint; morph does not embed an HTTP server.

Definition at line 308 of file remote.hpp.

◆ minProtocolVersion

std::uint32_t morph::backend::ServerConfig::minProtocolVersion = ::morph::wire::kProtocolVersion

Oldest protocol version this server accepts in reply to "hello". Must not exceed maxProtocolVersion.

Definition at line 312 of file remote.hpp.

◆ maxProtocolVersion

std::uint32_t morph::backend::ServerConfig::maxProtocolVersion = ::morph::wire::kProtocolVersion

Newest protocol version this server accepts in reply to "hello". Widen the range when a kProtocolVersion bump must keep serving older clients through their deprecation window (see docs/spec/core/wire.md, "Action-evolution policy").

Definition at line 318 of file remote.hpp.

◆ payloadCompleteness

PayloadCompleteness morph::backend::ServerConfig::payloadCompleteness = PayloadCompleteness::Lenient

Whether an execute body must carry every field the action's served schema marks required. See PayloadCompleteness for why Lenient is the default.

Definition at line 323 of file remote.hpp.

◆ services

std::vector<std::shared_ptr<IEnvelopeService> > morph::backend::ServerConfig::services

Extensions that answer envelope kinds the server does not know itself, consulted in order. Empty: none, and every unknown kind is answered err "unknown envelope kind: <kind>". A null entry is refused by the constructor.

Definition at line 329 of file remote.hpp.

◆ coalesceWindow

std::chrono::milliseconds morph::backend::ServerConfig::coalesceWindow {50}

How long a connection's changes are merged before they are sent as one changes event.

The window opens at the first change queued for the connection, and its queue is sent when the window closes, or at once when 256 keys are queued. Zero sends each fan-out's event at once, unmerged. Negative is refused by the constructor.

Definition at line 338 of file remote.hpp.


The documentation for this struct was generated from the following file: