pub struct BackgroundPrefetchWorker { /* private fields */ }Expand description
One bounded background prefetch worker with exact cancellation and deterministic shutdown.
Implementations§
Source§impl BackgroundPrefetchWorker
impl BackgroundPrefetchWorker
Sourcepub fn new<F>(
capacity: usize,
thread_name: impl Into<String>,
operation: F,
) -> Result<Self, BackgroundPrefetchWorkerError>
pub fn new<F>( capacity: usize, thread_name: impl Into<String>, operation: F, ) -> Result<Self, BackgroundPrefetchWorkerError>
Starts a named worker which executes one backend-owned operation at a time.
Sourcepub fn submit(
&self,
id: &OffloadUnitId,
resident: bool,
) -> Result<(), BackgroundPrefetchWorkerError>
pub fn submit( &self, id: &OffloadUnitId, resident: bool, ) -> Result<(), BackgroundPrefetchWorkerError>
Admits or coalesces one operation after the backend reports current residency.
Sourcepub fn wait(
&self,
id: &OffloadUnitId,
) -> Result<PrefetchDemandResolution<String>, BackgroundPrefetchWorkerError>
pub fn wait( &self, id: &OffloadUnitId, ) -> Result<PrefetchDemandResolution<String>, BackgroundPrefetchWorkerError>
Waits for background ownership to resolve and consumes its exact result.
Sourcepub fn cancel(&self) -> Result<(), BackgroundPrefetchWorkerError>
pub fn cancel(&self) -> Result<(), BackgroundPrefetchWorkerError>
Cancels queued work, fences in-flight work, and returns its first failure.
Sourcepub fn report(
&self,
) -> Result<BackgroundPrefetchReport, BackgroundPrefetchWorkerError>
pub fn report( &self, ) -> Result<BackgroundPrefetchReport, BackgroundPrefetchWorkerError>
Returns an immutable lifecycle and backpressure report.
Sourcepub fn wait_idle(&self) -> Result<(), BackgroundPrefetchWorkerError>
pub fn wait_idle(&self) -> Result<(), BackgroundPrefetchWorkerError>
Waits until all admitted work reaches a terminal state.
Trait Implementations§
Source§impl Drop for BackgroundPrefetchWorker
impl Drop for BackgroundPrefetchWorker
Auto Trait Implementations§
impl !RefUnwindSafe for BackgroundPrefetchWorker
impl !UnwindSafe for BackgroundPrefetchWorker
impl Freeze for BackgroundPrefetchWorker
impl Send for BackgroundPrefetchWorker
impl Sync for BackgroundPrefetchWorker
impl Unpin for BackgroundPrefetchWorker
impl UnsafeUnpin for BackgroundPrefetchWorker
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