Skip to main content

MobSessionService

Trait MobSessionService 

Source
pub trait MobSessionService:
    SessionServiceCommsExt
    + SessionServiceControlExt
    + SessionServiceHistoryExt {
    // Provided methods
    fn subscribe_session_events<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<EventStream, StreamError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn supports_persistent_sessions(&self) -> bool { ... }
    fn runtime_adapter(&self) -> Option<Arc<RuntimeSessionAdapter>> { ... }
    fn session_belongs_to_mob<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 SessionId,
        _mob_id: &'life2 MobId,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn load_persisted_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn apply_runtime_turn<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 SessionId,
        _run_id: RunId,
        _req: StartTurnRequest,
        _boundary: RunApplyBoundary,
        _contributing_input_ids: Vec<InputId>,
    ) -> Pin<Box<dyn Future<Output = Result<CoreApplyOutput, SessionError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn discard_live_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn cancel_all_checkpointers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn rearm_all_checkpointers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Extension trait for session services used by the mob runtime.

Builds on SessionServiceCommsExt from core so mob orchestration can use comms/injector access without per-crate bridge traits.

Provided Methods§

Source

fn subscribe_session_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<EventStream, StreamError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Subscribe to session-wide events regardless of triggering interaction.

Source

fn supports_persistent_sessions(&self) -> bool

Whether this service satisfies the persistent-session contract required by REQ-MOB-030.

Source

fn runtime_adapter(&self) -> Option<Arc<RuntimeSessionAdapter>>

Source

fn session_belongs_to_mob<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, _mob_id: &'life2 MobId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Whether a listed session belongs to the given mob for reconciliation.

Source

fn load_persisted_session<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the persisted session snapshot when available.

Source

fn apply_runtime_turn<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, _run_id: RunId, _req: StartTurnRequest, _boundary: RunApplyBoundary, _contributing_input_ids: Vec<InputId>, ) -> Pin<Box<dyn Future<Output = Result<CoreApplyOutput, SessionError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn discard_live_session<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Cancel all active checkpointer gates.

After this call in-flight saves complete but subsequent checkpoint calls on any session are no-ops. Call during stop() to prevent checkpoint writes from racing with external cleanup.

Source

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

Re-enable checkpointer gates cancelled by [cancel_all_checkpointers].

Call during resume() to restore periodic persistence.

Implementations on Foreign Types§

Source§

impl<B> MobSessionService for EphemeralSessionService<B>
where B: SessionAgentBuilder + 'static,

Source§

fn supports_persistent_sessions(&self) -> bool

Source§

fn runtime_adapter(&self) -> Option<Arc<RuntimeSessionAdapter>>

Source§

fn subscribe_session_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<EventStream, StreamError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn session_belongs_to_mob<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, _mob_id: &'life2 MobId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn load_persisted_session<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn discard_live_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn apply_runtime_turn<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, run_id: RunId, req: StartTurnRequest, boundary: RunApplyBoundary, contributing_input_ids: Vec<InputId>, ) -> Pin<Box<dyn Future<Output = Result<CoreApplyOutput, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<B> MobSessionService for PersistentSessionService<B>
where B: SessionAgentBuilder + 'static,

Source§

fn supports_persistent_sessions(&self) -> bool

Source§

fn runtime_adapter(&self) -> Option<Arc<RuntimeSessionAdapter>>

Source§

fn subscribe_session_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<EventStream, StreamError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn session_belongs_to_mob<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 SessionId, _mob_id: &'life2 MobId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

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

Source§

fn discard_live_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, ) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn apply_runtime_turn<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 SessionId, run_id: RunId, req: StartTurnRequest, boundary: RunApplyBoundary, contributing_input_ids: Vec<InputId>, ) -> Pin<Box<dyn Future<Output = Result<CoreApplyOutput, SessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

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

Source§

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

Implementors§