pub struct WorkflowTaskCleanupSupervisor<S> { /* private fields */ }Expand description
Discovers, shards, and cleans terminal Tasks with bounded concurrency.
Implementations§
Source§impl<S> WorkflowTaskCleanupSupervisor<S>where
S: WorkflowTaskRetentionStore + 'static,
impl<S> WorkflowTaskCleanupSupervisor<S>where
S: WorkflowTaskRetentionStore + 'static,
Sourcepub fn new(
store: Arc<S>,
owner: WorkerId,
config: WorkflowTaskCleanupSupervisorConfig,
) -> Self
pub fn new( store: Arc<S>, owner: WorkerId, config: WorkflowTaskCleanupSupervisorConfig, ) -> Self
Creates a cleanup supervisor with system timers.
Sourcepub fn with_sleeper(self, sleeper: Arc<dyn WorkflowWorkerSleeper>) -> Self
pub fn with_sleeper(self, sleeper: Arc<dyn WorkflowWorkerSleeper>) -> Self
Overrides sleeping for deterministic runtimes and tests.
Sourcepub fn with_metrics(self, metrics: WorkflowTaskCleanupSupervisorMetrics) -> Self
pub fn with_metrics(self, metrics: WorkflowTaskCleanupSupervisorMetrics) -> Self
Uses shared lock-free health metrics.
Sourcepub fn with_observer(
self,
observer: Arc<dyn WorkflowTaskCleanupObserver>,
) -> Self
pub fn with_observer( self, observer: Arc<dyn WorkflowTaskCleanupObserver>, ) -> Self
Attaches a non-blocking low-cardinality outcome observer.
Sourcepub const fn metrics(&self) -> &WorkflowTaskCleanupSupervisorMetrics
pub const fn metrics(&self) -> &WorkflowTaskCleanupSupervisorMetrics
Returns this supervisor’s health metrics.
Sourcepub async fn scan_once(
&self,
) -> Result<WorkflowTaskCleanupSupervisorReport, WorkflowStoreError>
pub async fn scan_once( &self, ) -> Result<WorkflowTaskCleanupSupervisorReport, WorkflowStoreError>
Performs one stable paginated discovery and bounded cleanup scan.
Per-tenant failures are isolated. Discovery failure aborts the scan.
§Errors
Returns a typed store error when tenant discovery fails.
Sourcepub async fn run(
&self,
shutdown: &CancellationToken,
) -> WorkflowTaskCleanupSupervisorReport
pub async fn run( &self, shutdown: &CancellationToken, ) -> WorkflowTaskCleanupSupervisorReport
Continuously rescans until cancellation.
A scan already in progress is drained before shutdown.
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for WorkflowTaskCleanupSupervisor<S>
impl<S> !UnwindSafe for WorkflowTaskCleanupSupervisor<S>
impl<S> Freeze for WorkflowTaskCleanupSupervisor<S>
impl<S> Send for WorkflowTaskCleanupSupervisor<S>
impl<S> Sync for WorkflowTaskCleanupSupervisor<S>
impl<S> Unpin for WorkflowTaskCleanupSupervisor<S>
impl<S> UnsafeUnpin for WorkflowTaskCleanupSupervisor<S>
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