Skip to main content

WorkflowTaskRetentionStore

Trait WorkflowTaskRetentionStore 

Source
pub trait WorkflowTaskRetentionStore: WorkflowStore {
    // Required methods
    fn list_task_cleanup_tenants(
        &self,
        after: Option<WorkflowTenantId>,
        limit: WorkflowTenantListLimit,
    ) -> WorkflowStoreFuture<'_, Result<Vec<WorkflowTenantId>, WorkflowStoreError>>;
    fn claim_task_cleanup(
        &self,
        tenant_id: WorkflowTenantId,
        owner: WorkerId,
        lease: LeaseDuration,
    ) -> WorkflowStoreFuture<'_, Result<Option<WorkflowTaskCleanupLease>, WorkflowStoreError>>;
    fn compact_terminal_tasks(
        &self,
        lease: WorkflowTaskCleanupLease,
        retention: WorkflowTaskRetention,
        limit: WorkflowTaskCleanupLimit,
    ) -> WorkflowStoreFuture<'_, Result<Vec<WorkflowTaskTombstone>, WorkflowStoreError>>;
    fn heartbeat_task_cleanup(
        &self,
        lease: WorkflowTaskCleanupLease,
        extension: LeaseDuration,
    ) -> WorkflowStoreFuture<'_, Result<WorkflowTaskCleanupLease, WorkflowStoreError>>;
    fn list_task_tombstones(
        &self,
        tenant_id: WorkflowTenantId,
        after: Option<WorkflowTaskTombstoneCursor>,
        limit: WorkflowTaskTombstoneLimit,
    ) -> WorkflowStoreFuture<'_, Result<Vec<WorkflowTaskTombstone>, WorkflowStoreError>>;
    fn release_task_cleanup(
        &self,
        lease: WorkflowTaskCleanupLease,
    ) -> WorkflowStoreFuture<'_, Result<(), WorkflowStoreError>>;
}
Expand description

Optional fenced control plane for physically removing terminal Tasks.

Implementations must write an immutable tombstone in the same atomic operation that removes execution state. Active Tasks are never eligible.

Required Methods§

Source

fn list_task_cleanup_tenants( &self, after: Option<WorkflowTenantId>, limit: WorkflowTenantListLimit, ) -> WorkflowStoreFuture<'_, Result<Vec<WorkflowTenantId>, WorkflowStoreError>>

Discovers tenants that currently own terminal Tasks.

Results are ordered lexicographically and strictly follow after.

Source

fn claim_task_cleanup( &self, tenant_id: WorkflowTenantId, owner: WorkerId, lease: LeaseDuration, ) -> WorkflowStoreFuture<'_, Result<Option<WorkflowTaskCleanupLease>, WorkflowStoreError>>

Claims one tenant’s cleanup partition if it is idle or expired.

Source

fn compact_terminal_tasks( &self, lease: WorkflowTaskCleanupLease, retention: WorkflowTaskRetention, limit: WorkflowTaskCleanupLimit, ) -> WorkflowStoreFuture<'_, Result<Vec<WorkflowTaskTombstone>, WorkflowStoreError>>

Atomically tombstones and removes one bounded terminal Task batch.

Source

fn heartbeat_task_cleanup( &self, lease: WorkflowTaskCleanupLease, extension: LeaseDuration, ) -> WorkflowStoreFuture<'_, Result<WorkflowTaskCleanupLease, WorkflowStoreError>>

Extends an exact current cleanup lease using store-authoritative time.

Source

fn list_task_tombstones( &self, tenant_id: WorkflowTenantId, after: Option<WorkflowTaskTombstoneCursor>, limit: WorkflowTaskTombstoneLimit, ) -> WorkflowStoreFuture<'_, Result<Vec<WorkflowTaskTombstone>, WorkflowStoreError>>

Lists immutable tombstones strictly after an optional cursor.

Source

fn release_task_cleanup( &self, lease: WorkflowTaskCleanupLease, ) -> WorkflowStoreFuture<'_, Result<(), WorkflowStoreError>>

Releases a current unexpired cleanup lease.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§