pub struct AppTasks { /* private fields */ }Implementations§
Source§impl AppTasks
impl AppTasks
pub fn new() -> Self
Sourcepub fn with_auto_persist<F>(self, callback: F) -> Self
pub fn with_auto_persist<F>(self, callback: F) -> Self
Enable automatic persistence when task states change
pub async fn queue<T>(&self, task: T) -> Result<String, Report<TaskQueueError>>
pub async fn load_state(&self, states: HashMap<String, TaskState>)
pub async fn get_state(&self) -> HashMap<String, TaskState>
pub async fn get_status(&self, job_id: &str) -> Option<TaskStatus>
pub async fn get_task(&self, task_id: &str) -> Option<TaskState>
pub async fn get_result(&self, job_id: &str) -> Option<CachedJobResult>
pub async fn get_job_metrics(&self, job_id: &str) -> Option<JobMetrics>
pub async fn list_tasks( &self, status: Option<TaskStatus>, limit: Option<usize>, ) -> Vec<TaskState>
pub async fn get_tasks_by_status(&self, status: TaskStatus) -> Vec<TaskState>
pub async fn store_success( &self, job_id: String, data: Value, ttl: Option<Duration>, )
pub async fn store_failure( &self, job_id: String, error: String, ttl: Option<Duration>, )
pub async fn cleanup_old_tasks(&self, older_than: DateTime<Utc>) -> usize
pub fn get_task_metrics(&self) -> MetricsSnapshot
pub fn queue_depth(&self) -> u64
pub fn is_healthy(&self) -> bool
pub fn health_status(&self) -> HealthStatus
pub fn shutdown(&self)
pub fn is_shutting_down(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppTasks
impl<'de> Deserialize<'de> for AppTasks
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AppTasks
impl !RefUnwindSafe for AppTasks
impl Send for AppTasks
impl Sync for AppTasks
impl Unpin for AppTasks
impl !UnwindSafe for AppTasks
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