Module revocation

Module revocation 

Source
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§

PatternRevocation
A pattern-based revocation rule
RevocationManager
Revocation manager for tracking revoked tasks
RevocationRequest
A request to revoke a task
RevocationResult
Result of a revocation check
RevocationState
Serializable revocation state for persistence
SerializablePatternRevocation
Serializable form of PatternRevocation
WorkerRevocationManager
Thread-safe revocation manager for workers

Enums§

RevocationMode
Revocation mode for how to handle a revoked task