Skip to main content

NotifyWaitSet

Struct NotifyWaitSet 

Source
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

Source

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.

Source

pub fn enter(&self)

A PP target joined the chain (C dbNotifyAdd). Balanced by exactly one Self::leave.

Source

pub fn leave(&self)

A record finished its contribution (C dbNotifyCompletion). Fires the completion oneshot on the leave that empties the set.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more