pub enum ProcessCompletion {
Sync,
Async(Receiver<()>),
}Expand description
The completion outcome of an externally-initiated record process cycle —
the value a caller learns after driving the synchronous head of a
dbPutNotify / CA WRITE_NOTIFY.
This is the contract the RTEMS CA driver consumes: the CA thread drives
the synchronous head of a put (C dbProcessNotify, rsrv/camessage.c
write_notify_action) to completion — on RTEMS via park_on — then
matches this value to decide whether to reply inline or return now and let
background infrastructure deliver the completion later. The caller learns
sync-vs-async as a typed value, not by inferring it from Option::is_some.
§C parity (dbNotify.c)
The C processNotify state machine forks a put-notify exactly here:
Self::Sync— the record was neither active (pact) nor selected for processing, soprocessNotifyCommonrunscallDone(dbNotify.c:270), which firesdoneCallbackINLINE on the calling thread (dbNotify.c:182). Our fully-synchronous chain drains theNotifyWaitSetbefore the put entry returns.Self::Async— the record waspact(notifyRestartInProgress,dbNotify.c:225-231) or processed into an async device (notifyProcessInProgress,dbNotify.c:252-263). Completion is deferred todbNotifyCompletion(dbNotify.c:445-475), which fires the user callback viacallbackRequest(:466/:470) when the tracked waitList empties. OurNotifyWaitSet::leave-to-zero fires thehandleoneshot at that same moment.
§Invariant (by construction)
Exactly one of {Sync returned, the Async handle fires exactly once} per
initiated cycle. The single owner of the fire is NotifyWaitSet: its
leave-to-zero takes the oneshot sender and sends once, so the handle can
never fire twice; and Sync is returned only when the wait-set already
drained, so no handle is outstanding to fire. There is no parallel
signalling path — the oneshot is the sole completion channel.
Variants§
Sync
The cycle settled within the calling thread — the caller replies inline.
Async(Receiver<()>)
The cycle went async; handle fires exactly once when the tracked
FLNK/OUT chain settles (C dbNotifyCompletion).
Implementations§
Source§impl ProcessCompletion
impl ProcessCompletion
Sourcepub fn into_handle(self) -> Option<Receiver<()>>
pub fn into_handle(self) -> Option<Receiver<()>>
The completion handle if this cycle went async, else None. The CA
WRITE_NOTIFY dispatch uses this to choose inline reply (None) vs a
spawned completion task (Some(rx)).