pub struct CallbackPool { /* private fields */ }Expand description
The callback executor pool: three independent priority bands, each with its
own bounded ring and worker thread(s). Port of the callbackQueue[] +
callbackTask machinery in callback.c.
Dropping the pool shuts every band down and joins its workers (parity with
callbackStop/callbackCleanup, callback.c:237-284).
Implementations§
Source§impl CallbackPool
impl CallbackPool
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a pool with the C defaults: callbackQueueSize capacity per band
(callback.c:51) and callbackThreadsDefault worker(s) per band
(callback.c:66).
Sourcepub fn with_config(queue_size: usize, threads_per_priority: usize) -> Self
pub fn with_config(queue_size: usize, threads_per_priority: usize) -> Self
Build a pool with an explicit ring capacity and worker count per band.
threads_per_priority is clamped to at least 1 (C callbackParallelThreads
forces count >= 1, callback.c:171).
Sourcepub fn handle(&self) -> CallbackHandle
pub fn handle(&self) -> CallbackHandle
A cheap, clonable submission handle (see CallbackHandle).
Sourcepub fn request(
&self,
priority: CallbackPriority,
cb: Callback,
) -> Result<(), CallbackError>
pub fn request( &self, priority: CallbackPriority, cb: Callback, ) -> Result<(), CallbackError>
Enqueue cb on priority — convenience wrapper over
CallbackHandle::request.
Sourcepub fn overflow_count(&self, priority: CallbackPriority) -> u64
pub fn overflow_count(&self, priority: CallbackPriority) -> u64
Lifetime overflow count for a band — C queueOverflows
(callback.c:57).