chronon::ReliablePortSender
#include <ReliablePortSender.hpp>
Public Functions
| Name | |
|---|---|
| template <typename... Values> bool | submit(Values &&... values) |
| template <typename... Values> bool | send(Values &&... values) |
| bool | retry() |
| uint64_t | pendingSinceCycle() const |
| size_t | pendingCount() const |
| size_t | pendingCapacity() |
| bool | pending() const |
| ReliablePortSender & | operator=(const ReliablePortSender & ) =delete |
| ReliablePortSender & | operator=(ReliablePortSender && ) =delete |
| template <auto KeyFn> bool | flushPending(FlushRange keep_range) |
| template <typename Predicate > bool | cancelPendingIf(Predicate && predicate) |
| bool | cancelPending() |
| void | cancelInFlight() |
| ReliablePortSender(OutPort< Ts > &... ports) | |
| ReliablePortSender(const ReliablePortSender & ) =delete | |
| ReliablePortSender(ReliablePortSender && ) =delete |
Public Attributes
| Name | |
|---|---|
| size_t | PENDING_CAPACITY |
| uint64_t | NO_CYCLE |
Detailed Description
template <typename... Ts>
class chronon::ReliablePortSender;
Producer-owned, bounded retry state for one logical port publication.
A failed send retains exactly one payload tuple. Calling send() again in a later producer cycle retries that tuple before observing the new arguments, which supports the usual stall-until-delivered pattern without a model-owned optional/deque. Multi-port instances publish through PortTransaction, so a retry is visible at every destination or at none of them.
The object is cache-line aligned and accessed only by its owning Unit. It contains no lock, atomic, heap allocation, or receiver-shared mutable state. Ordinary OutPort::send()/canSend() do not know that reliable senders exist.
OutPort<Message> out{this, "out"};
ReliablePortSender reliable{out};
void tick() override {
// Do not advance architectural state while false is returned. On the
// next call reliable retries its retained payload, not this argument.
if (!reliable.send(Message{next_sequence_})) return;
++next_sequence_;
}
Public Functions Documentation
function submit
template <typename... Values>
inline bool submit(
Values &&... values
)
Submit a new logical payload. Calling submit() while the one framework slot is occupied is a protocol error and reports the unit, ports, payload types, and the cycle at which the retained request began.
function send
template <typename... Values>
inline bool send(
Values &&... values
)
Publish a new logical payload, or retry the retained payload.
When a payload is pending, the supplied arguments are deliberately not consumed. A true result always completes the same logical operation that previously returned false, so callers must not advance its source state while stalled.
function retry
inline bool retry()
Retry the retained payload at most once per producer cycle.
function pendingSinceCycle
inline uint64_t pendingSinceCycle() const
function pendingCount
inline size_t pendingCount() const
function pendingCapacity
static inline size_t pendingCapacity()
function pending
inline bool pending() const
function operator=
ReliablePortSender & operator=(
const ReliablePortSender &
) =delete
function operator=
ReliablePortSender & operator=(
ReliablePortSender &&
) =delete
function flushPending
template <auto KeyFn>
inline bool flushPending(
FlushRange keep_range
)
One-port convenience matching InPort::flush
function cancelPendingIf
template <typename Predicate >
inline bool cancelPendingIf(
Predicate && predicate
)
Cancel the pending tuple when an inline, non-throwing predicate accepts it. The predicate receives one const payload reference per OutPort.
function cancelPending
inline bool cancelPending()
Cancel the retained, not-yet-published payload tuple.
function cancelInFlight
inline void cancelInFlight()
Cancel the retained request and every already-published message.
function ReliablePortSender
inline explicit ReliablePortSender(
OutPort< Ts > &... ports
)
function ReliablePortSender
ReliablePortSender(
const ReliablePortSender &
) =delete
function ReliablePortSender
ReliablePortSender(
ReliablePortSender &&
) =delete
Public Attributes Documentation
variable PENDING_CAPACITY
static size_t PENDING_CAPACITY = 1;
variable NO_CYCLE
static uint64_t NO_CYCLE = std::numeric_limits<uint64_t>::max();
Updated on 2026-07-18 at 18:58:49 +0000