Skip to main content

SessionTaskRegistry

Trait SessionTaskRegistry 

Source
pub trait SessionTaskRegistry: Send + Sync {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        input: CreateSessionTask,
    ) -> Pin<Box<dyn Future<Output = Result<SessionTask>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        task_id: &'life1 str,
        update: SessionTaskUpdate,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SessionTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SessionTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        filter: Option<&'life1 SessionTaskFilter>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn request_cancel<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SessionTask>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        task_id: &'life1 str,
        message: NewTaskMessage,
    ) -> Pin<Box<dyn Future<Output = Result<TaskMessage>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_messages<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        task_id: &'life1 str,
        limit: Option<u32>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Session task registry. Implementations emit task.created / task.updated (full snapshots) and task.message.* events on the owning session’s event stream.

Required Methods§

Source

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

Create a task (idempotent on caller-supplied ID: re-creating an existing ID returns the stored task unchanged).

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, task_id: &'life1 str, update: SessionTaskUpdate, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply a partial update through apply_task_update invariants.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, filter: Option<&'life1 SessionTaskFilter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn request_cancel<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionTask>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record cooperative cancel intent (idempotent). Does not change state; the executor winds down and reports the terminal state.

Source

fn record_message<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, task_id: &'life1 str, message: NewTaskMessage, ) -> Pin<Box<dyn Future<Output = Result<TaskMessage>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist a message on the task’s channel. Answering messages (in_reply_to set) clear a matching pending input request and return the task to running.

Source

fn list_messages<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, task_id: &'life1 str, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List messages on the task’s channel, oldest first.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§