Skip to main content

NotificationStore

Trait NotificationStore 

Source
pub trait NotificationStore: Send + Sync {
    // Provided methods
    fn record_background_spawn<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _spawn: &'life1 BackgroundSpawn,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn finish_background_spawn<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn background_spawns_for_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundSpawn>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn take_background_spawns<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundSpawn>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn enqueue_notification<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _entry: &'life1 NotificationEntry,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn enqueue_goal_notification<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entry: &'life1 NotificationEntry,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_pending_notifications<'life0, 'async_trait>(
        &'life0 self,
        _limit: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<NotificationEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn mark_notification_delivered<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _notification_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn increment_notification_attempt<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _notification_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn cleanup_expired_notifications<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn notices_delivered_since<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 str,
        _since: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DeliveredNotice>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Notification delivery queue persistence.

Provided Methods§

Source

fn record_background_spawn<'life0, 'life1, 'async_trait>( &'life0 self, _spawn: &'life1 BackgroundSpawn, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a background sub-agent that has started.

Source

fn finish_background_spawn<'life0, 'life1, 'async_trait>( &'life0 self, _id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Forget a background sub-agent that has ended.

Source

fn background_spawns_for_session<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundSpawn>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The background sub-agents running for a session.

Source

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

Remove and return every recorded background sub-agent.

Source

fn enqueue_notification<'life0, 'life1, 'async_trait>( &'life0 self, _entry: &'life1 NotificationEntry, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Enqueue a notification for delivery.

Source

fn enqueue_goal_notification<'life0, 'life1, 'async_trait>( &'life0 self, entry: &'life1 NotificationEntry, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically claim a goal’s notification slot and enqueue its notification.

Returns false when another writer has already claimed the goal. Stores that do not support transactions may fall back to enqueueing only.

Source

fn get_pending_notifications<'life0, 'async_trait>( &'life0 self, _limit: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<NotificationEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get pending notifications ordered by priority (critical first), then creation time.

Source

fn mark_notification_delivered<'life0, 'life1, 'async_trait>( &'life0 self, _notification_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark a notification as delivered.

Source

fn increment_notification_attempt<'life0, 'life1, 'async_trait>( &'life0 self, _notification_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Increment the attempt counter for a notification.

Source

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

Delete expired status_update notifications (past their expires_at).

Source

fn notices_delivered_since<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _since: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeliveredNotice>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Notices delivered to session_id at or after since, oldest first: what the owner was already told while a turn ran, so its reply can agree with them (crate::goals::notices_turn_context).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§