Skip to main content

TaskAttributionStore

Trait TaskAttributionStore 

Source
pub trait TaskAttributionStore: Send + Sync {
    // Required methods
    fn insert<'a>(
        &'a self,
        tenant_id: &'a str,
        task_id: &'a str,
        attribution: TaskAttribution,
    ) -> TaskStoreFuture<'a, ()>;
    fn get<'a>(
        &'a self,
        tenant_id: &'a str,
        task_id: &'a str,
    ) -> TaskStoreFuture<'a, Option<TaskAttribution>>;
    fn claim<'a>(
        &'a self,
        tenant_id: &'a str,
        task_id: &'a str,
    ) -> TaskStoreFuture<'a, Option<TaskAttribution>>;
    fn remove<'a>(
        &'a self,
        tenant_id: &'a str,
        task_id: &'a str,
    ) -> TaskStoreFuture<'a, ()>;
}
Expand description

Persists pre-priced, non-identifying attribution under a durable task ID.

Required Methods§

Source

fn insert<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, attribution: TaskAttribution, ) -> TaskStoreFuture<'a, ()>

Associate a task with its resolved price and fixed origin category.

Source

fn get<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> TaskStoreFuture<'a, Option<TaskAttribution>>

Resolve an association without consuming it.

Source

fn claim<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> TaskStoreFuture<'a, Option<TaskAttribution>>

Atomically consume and return an association.

A completed durable task can be returned by many later polls. Using this operation before recording usage guarantees that only one process can account for that task.

Source

fn remove<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> TaskStoreFuture<'a, ()>

Remove an association after a terminal task is accounted for.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§