Expand description
Task Revocation
This module provides enhanced task revocation capabilities:
- Revoke by ID: Revoke a specific task by its ID
- Revoke by Pattern: Revoke tasks matching a name pattern (glob or regex)
- Bulk Revocation: Revoke multiple tasks at once
- Persistent Revocation: Revocations that survive worker restarts
§Example
use celers_core::revocation::{RevocationManager, RevocationMode};
use uuid::Uuid;
let mut manager = RevocationManager::new();
let task_id = Uuid::new_v4();
// Revoke a single task
manager.revoke(task_id, RevocationMode::Terminate);
// Revoke all tasks matching a pattern
manager.revoke_by_pattern("email.*", RevocationMode::Ignore);
// Check if a task is revoked
assert!(manager.is_revoked(task_id));Structs§
- Pattern
Revocation - A pattern-based revocation rule
- Revocation
Manager - Revocation manager for tracking revoked tasks
- Revocation
Request - A request to revoke a task
- Revocation
Result - Result of a revocation check
- Revocation
State - Serializable revocation state for persistence
- Serializable
Pattern Revocation - Serializable form of
PatternRevocation - Worker
Revocation Manager - Thread-safe revocation manager for workers
Enums§
- Revocation
Mode - Revocation mode for how to handle a revoked task