pub struct ScanOnceQueue { /* private fields */ }Expand description
The scanOnce facility: one bounded ring drained by one worker thread.
Dropping it stops and joins the worker.
Implementations§
Source§impl ScanOnceQueue
impl ScanOnceQueue
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Build with an explicit ring capacity (clamped to at least 1).
Sourcepub fn start(&self)
pub fn start(&self)
Create the drain thread now — C initOnce (dbScan.c:768-780), which
scanInit calls once the menuScan count is known and before it
spawns the periodic threads (dbScan.c:201-205).
The worker otherwise appears at the first scanOnce, which is late
enough that an IOC that has never run a one-shot has no scanOnce
thread where C always does — visible in taskwdShow, and it defers
C’s fail-at-init contract for a thread that cannot be created. Calling
this at the port’s own scanInit is what removes the difference; it
stays idempotent, so the lazy path is still the safety net for a
scanOnce that arrives before any IOC init.
Sourcepub fn handle(&self) -> ScanOnceHandle
pub fn handle(&self) -> ScanOnceHandle
A cheap, clonable submission handle (see ScanOnceHandle).
Sourcepub fn scan_once(&self, cb: OnceCallback) -> Result<(), ScanOnceOverflow>
pub fn scan_once(&self, cb: OnceCallback) -> Result<(), ScanOnceOverflow>
Enqueue cb for one-shot processing — convenience wrapper over
ScanOnceHandle::scan_once.
Sourcepub fn overflow_count(&self) -> u64
pub fn overflow_count(&self) -> u64
Lifetime overflow count — C onceQOverruns (dbScan.c:67).
Sourcepub fn stats(&self, reset: bool) -> ScanOnceQueueStats
pub fn stats(&self, reset: bool) -> ScanOnceQueueStats
C scanOnceQueueStatus (dbScan.c:734-751): sample the ring and,
when reset is set, clear the high-water mark.