pub struct TaskManager<GroupKey, Outcome> { /* private fields */ }
Expand description
Tracks tasks at the global conductor level, as well as each individual cell level.
Implementations§
Source§impl<GroupKey, Outcome> TaskManager<GroupKey, Outcome>
impl<GroupKey, Outcome> TaskManager<GroupKey, Outcome>
pub fn new( outcome_rx: Sender<(GroupKey, Outcome)>, parent_map: impl 'static + Send + Sync + Fn(&GroupKey) -> Option<GroupKey>, ) -> Self
pub fn new_instrumented( span: Span, outcome_rx: Sender<(GroupKey, Outcome)>, parent_map: impl 'static + Send + Sync + Fn(&GroupKey) -> Option<GroupKey>, ) -> Self
Sourcepub fn add_task<Fut: Future<Output = Outcome> + Send + 'static>(
&mut self,
key: GroupKey,
f: impl FnOnce(StopListener) -> Fut + Send + 'static,
)
pub fn add_task<Fut: Future<Output = Outcome> + Send + 'static>( &mut self, key: GroupKey, f: impl FnOnce(StopListener) -> Fut + Send + 'static, )
Add a task to a group
Sourcepub fn stop_group(&mut self, key: &GroupKey) -> GroupStop
pub fn stop_group(&mut self, key: &GroupKey) -> GroupStop
Remove a group, returning a future that can be waited upon for all tasks in that group to complete.
Auto Trait Implementations§
impl<GroupKey, Outcome> Freeze for TaskManager<GroupKey, Outcome>
impl<GroupKey, Outcome> !RefUnwindSafe for TaskManager<GroupKey, Outcome>
impl<GroupKey, Outcome> Send for TaskManager<GroupKey, Outcome>
impl<GroupKey, Outcome> Sync for TaskManager<GroupKey, Outcome>
impl<GroupKey, Outcome> Unpin for TaskManager<GroupKey, Outcome>where
GroupKey: Unpin,
impl<GroupKey, Outcome> !UnwindSafe for TaskManager<GroupKey, Outcome>
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