Skip to main content

QueueStore

Trait QueueStore 

Source
pub trait QueueStore: Send + Sync {
    // Required methods
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
    ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn enqueue<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
        request: QueuedRun,
    ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn claim_next<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
        expected: Revision,
        claimant: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<ClaimNextOutcome, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn ack_started<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
        run_id: &'life2 RunId,
    ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn remove<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
        run_id: &'life2 RunId,
    ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Process-local execution admission queue for one thread.

The deployment-owned user waiting queue is not this interface: MeowCore and Lion persist it before dispatching one attempt into Runtime. Losing this store loses the attempt and must never trigger cross-process replay.

Required Methods§

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads the current queue snapshot.

Source

fn enqueue<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, request: QueuedRun, ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Enqueues a run idempotently by operation_id and run_id.

Implementations preserve idempotency for the lifetime of the process.

Source

fn claim_next<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, expected: Revision, claimant: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<ClaimNextOutcome, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Claims the first unclaimed queue item at expected revision.

claimant identifies the single process-local driver attempt. A lost attempt is failed by the deployment owner and is never reclaimed here.

Source

fn ack_started<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, run_id: &'life2 RunId, ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Removes an item after the same run has been committed as the active thread checkpoint.

Implementations must make repeated acknowledgements for the same run idempotent.

Source

fn remove<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, run_id: &'life2 RunId, ) -> Pin<Box<dyn Future<Output = Result<QueueSnapshot, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Removes a queued run idempotently and returns the updated snapshot.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§