pub struct TaskManager { /* private fields */ }Expand description
Manages async task submission, tracking, and cancellation.
Implementations§
Source§impl TaskManager
impl TaskManager
Sourcepub fn from_settings(settings: &ApcoreSettings) -> Self
pub fn from_settings(settings: &ApcoreSettings) -> Self
Create a new TaskManager from settings.
Sourcepub fn submit(
&self,
task_id: String,
module_id: String,
) -> Result<(String, CancelToken), AxumApcoreError>
pub fn submit( &self, task_id: String, module_id: String, ) -> Result<(String, CancelToken), AxumApcoreError>
Submit a new async task. Returns the task ID and a CancelToken.
Sourcepub fn get_status(&self, task_id: &str) -> Option<TaskStatus>
pub fn get_status(&self, task_id: &str) -> Option<TaskStatus>
Get the status of a task.
Sourcepub fn get_task_info(&self, task_id: &str) -> Option<TaskInfo>
pub fn get_task_info(&self, task_id: &str) -> Option<TaskInfo>
Get full info for a task.
Sourcepub fn get_result(&self, task_id: &str) -> Option<Value>
pub fn get_result(&self, task_id: &str) -> Option<Value>
Get the result of a completed task.
Sourcepub fn list_tasks(&self, status_filter: Option<&str>) -> Vec<TaskInfo>
pub fn list_tasks(&self, status_filter: Option<&str>) -> Vec<TaskInfo>
List tasks, optionally filtered by status.
Trait Implementations§
Source§impl Clone for TaskManager
impl Clone for TaskManager
Source§fn clone(&self) -> TaskManager
fn clone(&self) -> TaskManager
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 Freeze for TaskManager
impl RefUnwindSafe for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl UnsafeUnpin for TaskManager
impl UnwindSafe for TaskManager
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