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

Opt-in, connection-agnostic resource limits enforced by RemoteServer. More...

#include <remote.hpp>

Public Attributes

std::chrono::milliseconds executeTimeout {0}
 Max wall-clock time a single execute may take before the server sends an err "timeout" reply and discards the eventual strand result. 0 = no timeout (today's behavior).
std::size_t maxLiveModels {0}
 Max models this RemoteServer will hold live at once, across all callers. A register beyond this cap replies err "too many models". 0 = unbounded (today's behavior).
std::size_t maxInFlightExecutes {0}
 Max concurrent in-flight execute calls this server will accept before replying err "server busy" instead of dispatching. 0 = unbounded (today's behavior).

Detailed Description

Opt-in, connection-agnostic resource limits enforced by RemoteServer.

Every field defaults to 0, meaning "unbounded": a default-constructed policy applies no limit. Given as ServerConfig::limits, at construction. See docs/spec/core/backend.md.

Definition at line 55 of file remote.hpp.

Member Data Documentation

◆ executeTimeout

std::chrono::milliseconds morph::backend::LimitPolicy::executeTimeout {0}

Max wall-clock time a single execute may take before the server sends an err "timeout" reply and discards the eventual strand result. 0 = no timeout (today's behavior).

A handler that succeeds after the timeout answered still tells the connections watching what it changed, the caller included, by event.

An ordinary handler is never interrupted — it keeps running to completion on its strand, so this bounds the caller's wait, not the model. A handler returning core::async::Task is also asked to stop: its stop token is requested, and it unwinds at its next stop-aware co_await (see docs/spec/core/coroutines.md).

Definition at line 68 of file remote.hpp.

◆ maxLiveModels

std::size_t morph::backend::LimitPolicy::maxLiveModels {0}

Max models this RemoteServer will hold live at once, across all callers. A register beyond this cap replies err "too many models". 0 = unbounded (today's behavior).

Definition at line 73 of file remote.hpp.

◆ maxInFlightExecutes

std::size_t morph::backend::LimitPolicy::maxInFlightExecutes {0}

Max concurrent in-flight execute calls this server will accept before replying err "server busy" instead of dispatching. 0 = unbounded (today's behavior).

Definition at line 78 of file remote.hpp.


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