pub struct ClassifiedWorkerPool<C: WorkerClassification, W: ClassifiedWorker<C>, F: ClassifiedWorkerFactory<C, W>> { /* private fields */ }Implementations§
Source§impl<C: WorkerClassification, W: ClassifiedWorker<C>, F: ClassifiedWorkerFactory<C, W>> ClassifiedWorkerPool<C, W, F>
impl<C: WorkerClassification, W: ClassifiedWorker<C>, F: ClassifiedWorkerFactory<C, W>> ClassifiedWorkerPool<C, W, F>
Sourcepub fn new(
factory: F,
config: ClassifiedWorkerPoolConfig,
) -> ClassifiedWorkerPoolRef<C, W, F>
pub fn new( factory: F, config: ClassifiedWorkerPoolConfig, ) -> ClassifiedWorkerPoolRef<C, W, F>
Creates a classification-aware worker pool with explicit configuration.
A finite max_count is a target rather than a strict upper bound. When the
pool is full, no idle worker can be replaced, and a requested classification
has no created or pending worker, the pool may temporarily exceed the target.
Excess workers are removed when they are returned and are not needed by a
waiter. None leaves the pool-wide worker count unlimited.
pub fn cleanup_idle_worker(&self) -> usize
pub async fn get_worker( self: &ClassifiedWorkerPoolRef<C, W, F>, classification: C, ) -> PoolResult<ClassifiedWorkerGuard<C, W, F>>
pub async fn clear_all_worker(&self)
Auto Trait Implementations§
impl<C, W, F> !Freeze for ClassifiedWorkerPool<C, W, F>
impl<C, W, F> RefUnwindSafe for ClassifiedWorkerPool<C, W, F>where
F: RefUnwindSafe,
impl<C, W, F> Send for ClassifiedWorkerPool<C, W, F>
impl<C, W, F> Sync for ClassifiedWorkerPool<C, W, F>
impl<C, W, F> Unpin for ClassifiedWorkerPool<C, W, F>
impl<C, W, F> UnsafeUnpin for ClassifiedWorkerPool<C, W, F>
impl<C, W, F> UnwindSafe for ClassifiedWorkerPool<C, W, F>where
F: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more