WorkProvider

Trait WorkProvider 

Source
pub trait WorkProvider:
    'static
    + Send
    + Sync {
    // Required methods
    fn change_notifier(&self) -> &ChangeNotifier;
    fn next_task(&self) -> Option<Box<dyn WorkUnit + '_>>;
}
Expand description

A persistent source of work for multiple threads.

Required Methods§

Source

fn change_notifier(&self) -> &ChangeNotifier

Gets a reference to the notifier which raises an event when new work is available.

Source

fn next_task(&self) -> Option<Box<dyn WorkUnit + '_>>

Obtains the next unit of queued work from the provider.

Implementors§