Skip to main content

TriggerRepository

Trait TriggerRepository 

Source
pub trait TriggerRepository: Send + Sync {
    // Required methods
    fn get_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TriggerQueueItem>, RepositoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_oldest_pending_and_mark_processing<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<TriggerQueueItem>, RepositoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_retry_status<'life0, 'async_trait>(
        &'life0 self,
        params: UpdateRetryStatus,
    ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn recover_stuck_tasks<'life0, 'async_trait>(
        &'life0 self,
        threshold_seconds: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_by_id<'life0, 'async_trait>(
        &'life0 self,
        id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn queue_triggers_for_branch<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        branch_id: i64,
        new_hash: &'life1 CommitHash,
        executor: &'life2 mut SqliteConnection,
    ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Interface for trigger_queue table operations.

Required Methods§

Source

fn get_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<TriggerQueueItem>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns all the trigger queue items.

Source

fn find_oldest_pending_and_mark_processing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<TriggerQueueItem>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finds the oldest pending trigger queue item and marks it as processing in a transaction.

Source

fn update_retry_status<'life0, 'async_trait>( &'life0 self, params: UpdateRetryStatus, ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Schedules a retry or marks the trigger as failed if max attempts is reached.

Source

fn recover_stuck_tasks<'life0, 'async_trait>( &'life0 self, threshold_seconds: u64, ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Recovers tasks that have been stuck in PROCESSING for too long.

Source

fn delete_by_id<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes the trigger queue item with the given id.

Source

fn queue_triggers_for_branch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, branch_id: i64, new_hash: &'life1 CommitHash, executor: &'life2 mut SqliteConnection, ) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Queues trigger events for all subscriptions of a branch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§