Struct jatsl::TaskManager[][src]

pub struct TaskManager<Context> {
    pub context: Context,
    // some fields omitted
}

Manager for tasks and jobs

Provides context, handles resource availability changes and graceful termination

Fields

context: Context

Implementations

impl<Context> TaskManager<Context>[src]

pub fn new(
    task_id: usize,
    context: Context
) -> (Self, Receiver<ResourceStatus>, OneShotReceiver<()>, WatchSender<Option<()>>)
[src]

Create a new task manager for the given task and context

pub fn create_resource_handle(&self) -> TaskResourceHandle[src]

Create a new resource handle to notify about resource state

pub fn termination_signal(&self) -> impl Future<Output = ()>[src]

Future that completes when the job should gracefully shutdown

pub fn termination_signal_triggered(&self) -> bool[src]

Check if the job should enter graceful shutdown

pub async fn ready(&self)[src]

Function to indicate to the scheduler that this job is ready to fulfull its contract. This has no effect when called from within tasks.

Trait Implementations

impl<Context: Clone> Clone for TaskManager<Context>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.