tess 1.0.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
tess::experimental::maintenance::MaintenanceBackend Concept Reference

#include <tess/experimental/registered_maintenance.h>

Concept definition

template<typename Backend>
std::constructible_from<Backend, std::size_t> &&
requires(Backend& backend, const Backend& const_backend,
{ backend.schedule(task) } -> std::same_as<ScheduleResult>;
{ backend.run_some(budget) } -> std::same_as<BackendDrainResult>;
{ backend.flush() } -> std::same_as<BackendDrainResult>;
{ const_backend.metrics() } noexcept -> std::same_as<MaintenanceMetrics>;
{ const_backend.has_pending() } noexcept -> std::same_as<bool>;
}
Shared unit budget passed through one maintenance drain.
Definition maintenance.h:20
Long-lived derived-state maintenance operation.
Definition maintenance.h:44
Definition registered_maintenance.h:87

Detailed Description

Structural backend boundary used by the registered contract candidate.

The facade serializes run_some() and flush() calls with each other, but schedule() may run concurrently on many producer threads and concurrently with a drain. schedule(), has_pending(), and metrics() must therefore be thread-safe. Each accepted offer linearizes at synchronous execution or at lossless retention/coalescing. has_pending() linearizes against scheduling and draining and reports work still retained at its observation; a concurrent drain may consume accepted work before schedule() returns. A capacity result must not retain or execute that offer. Metrics counters are monotonic, but their no-throw diagnostic snapshot need not be transactional across fields while operations are in flight. Backends must not invoke one task concurrently with itself and must permit a running callback to schedule through the same facade.

Callback exceptions propagate verbatim. The invocation that throws is consumed rather than restored and its execution is counted. Offers coalesced into that same synchronous call-local invocation are consumed with it; every independently retained accepted offer remains reachable. The caller's authoritative dirty-mask/content-version state decides whether explicitly scheduling a retry is safe.