pub struct TaskManager<Context> {
pub context: Context,
/* private fields */
}
Expand description
Manager for tasks and jobs
Provides context, handles resource availability changes and graceful termination
Fields§
§context: Context
Implementations§
Source§impl<Context> TaskManager<Context>
impl<Context> TaskManager<Context>
Sourcepub fn new(
task_id: usize,
context: Context,
) -> (Self, Receiver<ResourceStatus>, OneShotReceiver<()>, WatchSender<Option<()>>)
pub fn new( task_id: usize, context: Context, ) -> (Self, Receiver<ResourceStatus>, OneShotReceiver<()>, WatchSender<Option<()>>)
Create a new task manager for the given task and context
Sourcepub fn create_resource_handle(&self) -> TaskResourceHandle
pub fn create_resource_handle(&self) -> TaskResourceHandle
Create a new resource handle to notify about resource state
Sourcepub fn termination_signal(&self) -> impl Future<Output = ()>
pub fn termination_signal(&self) -> impl Future<Output = ()>
Future that completes when the job should gracefully shutdown
Sourcepub fn termination_signal_triggered(&self) -> bool
pub fn termination_signal_triggered(&self) -> bool
Check if the job should enter graceful shutdown
Trait Implementations§
Source§impl<Context: Clone> Clone for TaskManager<Context>
impl<Context: Clone> Clone for TaskManager<Context>
Source§fn clone(&self) -> TaskManager<Context>
fn clone(&self) -> TaskManager<Context>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<Context> Freeze for TaskManager<Context>where
Context: Freeze,
impl<Context> !RefUnwindSafe for TaskManager<Context>
impl<Context> Send for TaskManager<Context>where
Context: Send,
impl<Context> Sync for TaskManager<Context>where
Context: Sync,
impl<Context> Unpin for TaskManager<Context>where
Context: Unpin,
impl<Context> !UnwindSafe for TaskManager<Context>
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