pub struct NotifyWaitSet { /* private fields */ }Expand description
Put-notify completion wait-set — the C dbNotify.c processNotify
waitList analogue (dbNotifyAdd / dbNotifyCompletion).
A ca_put_callback / WRITE_NOTIFY completion must fire only after the
originating (put-target) record AND every record reached through its
FLNK / OUT / process-action dispatch chain (synchronous or async)
has finished processing. A single wait-set owns the completion
oneshot; only it fires, and only when the last chain member leaves.
Counting convention: Self::new arms pending = 1 for the
originating record (which always joins). Every additional PP target
that will process under the active notify Self::enters on join
(C dbNotifyAdd), and every record Self::leaves when its
processing completes (C dbNotifyCompletion). The oneshot fires on
the leave that drops pending to zero.
Membership is BOTH counted and named, because the two questions have
different answers here and C only ever has to ask one of them. C keeps
no count at all — ellCount(&pnotifyPvt->waitList) (dbNotify.c:460)
IS its count, so its list answers “has the chain settled?” and “which
records must a cancel release?” at once. The port cannot merge them:
pending also carries contributions that own no record slot (the
initiator’s own hold, and a dbCaPutLinkCallback awaiting its network
completion — links.rs), which C models as state rather than as list
entries. So pending answers settlement and the joined list answers
cancellation, each with one meaning on every path.
Implementations§
Source§impl NotifyWaitSet
impl NotifyWaitSet
Sourcepub fn new(tx: Sender<()>) -> Arc<Self> ⓘ
pub fn new(tx: Sender<()>) -> Arc<Self> ⓘ
Arm a wait-set whose tx fires when the chain settles. pending
starts at 1 for the originating record — its completion leaves
that implicit slot, so a put with no chain targets fires
immediately on the originating record’s own completion.
No entry record: this is the chain-internal set, C’s dbNotifyAdd
bookkeeping without a processNotify of its own.
Self::for_entry_record is the dbProcessNotify arm.
Sourcepub fn enter(&self)
pub fn enter(&self)
A PP target joined the chain (C dbNotifyAdd). Balanced by exactly
one Self::leave.
Sourcepub fn leave(&self)
pub fn leave(&self)
A record finished its contribution (C dbNotifyCompletion). Fires
the completion oneshot on the leave that empties the set.
Sourcepub fn completed(&self) -> bool
pub fn completed(&self) -> bool
True once every chain member has left (the completion has fired).
Used by the put entry to decide synchronous (ProcessCompletion::Sync)
vs async-pending (ProcessCompletion::Async) completion.