Struct garage_block::repair::RepairWorker
source · pub struct RepairWorker { /* private fields */ }
Implementations§
source§impl RepairWorker
impl RepairWorker
pub fn new(manager: Arc<BlockManager>) -> Self
Trait Implementations§
source§impl Worker for RepairWorker
impl Worker for RepairWorker
fn name(&self) -> String
fn status(&self) -> WorkerStatus
source§fn work<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_must_exit: &'life1 mut Receiver<bool>
) -> Pin<Box<dyn Future<Output = Result<WorkerState, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn work<'life0, 'life1, 'async_trait>( &'life0 mut self, _must_exit: &'life1 mut Receiver<bool> ) -> Pin<Box<dyn Future<Output = Result<WorkerState, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Work: do a basic unit of work, if one is available (otherwise, should return
WorkerState::Idle immediately). We will do our best to not interrupt this future in the
middle of processing, it will only be interrupted at the last minute when Garage is trying
to exit and this hasn’t returned yet. This function may return an error to indicate that
its unit of work could not be processed due to an error: the error will be logged and
.work() will be called again after a short delay.
source§fn wait_for_work<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = WorkerState> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_for_work<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = WorkerState> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Wait for work: await for some task to become available. This future can be interrupted in
the middle for any reason, for example if an interrupt signal was recieved.