pub struct RealtimeSessionController { /* private fields */ }Expand description
Holds realtime session controller application-layer state or configuration. Use it with the documented coordinator methods; run, journal, event, provider, or port effects are called out on those methods rather than on construction.
Implementations§
Source§impl RealtimeSessionController
impl RealtimeSessionController
Sourcepub fn new(
sidecar: RealtimeSessionSidecar,
adapter: Arc<dyn RealtimeProviderAdapter>,
journal: Arc<dyn RunJournal>,
run_id: RunId,
agent_id: AgentId,
source: SourceRef,
runtime_package_fingerprint: impl Into<String>,
) -> Self
pub fn new( sidecar: RealtimeSessionSidecar, adapter: Arc<dyn RealtimeProviderAdapter>, journal: Arc<dyn RunJournal>, run_id: RunId, agent_id: AgentId, source: SourceRef, runtime_package_fingerprint: impl Into<String>, ) -> Self
Creates a new application::realtime value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.
Sourcepub fn connect(&mut self) -> Result<RealtimeSessionRecord, AgentError>
pub fn connect(&mut self) -> Result<RealtimeSessionRecord, AgentError>
Connect. This appends realtime connection intent/result records through the journal path and calls the configured realtime adapter to open the session.
Sourcepub fn send(
&mut self,
frame: RealtimeInputFrame,
) -> Result<RealtimeSessionRecord, AgentError>
pub fn send( &mut self, frame: RealtimeInputFrame, ) -> Result<RealtimeSessionRecord, AgentError>
Send. This journals the realtime send path and forwards one frame to the configured realtime adapter.
Sourcepub fn receive(&mut self) -> Result<Option<RealtimeSessionRecord>, AgentError>
pub fn receive(&mut self) -> Result<Option<RealtimeSessionRecord>, AgentError>
Receives one realtime output frame through the configured adapter. This records a receive request, calls the adapter, appends a received record when output is available, and updates the in-memory session cursor.
Sourcepub fn interrupt(
&mut self,
response_id: impl Into<String>,
) -> Result<RealtimeSessionRecord, AgentError>
pub fn interrupt( &mut self, response_id: impl Into<String>, ) -> Result<RealtimeSessionRecord, AgentError>
Interrupt. This records the interrupt path and sends the configured realtime interruption frame to the adapter session.
Sourcepub fn begin_restart(
&mut self,
) -> Result<Vec<RealtimeSessionRecord>, AgentError>
pub fn begin_restart( &mut self, ) -> Result<Vec<RealtimeSessionRecord>, AgentError>
Marks the active realtime session as beginning a restart.
This appends restart-requested and restart-started records and updates session state; the
adapter restart call happens in complete_restart.
Sourcepub fn complete_restart(
&mut self,
) -> Result<Vec<RealtimeSessionRecord>, AgentError>
pub fn complete_restart( &mut self, ) -> Result<Vec<RealtimeSessionRecord>, AgentError>
Complete restart. This records restart completion and updates session state after the adapter reports success.
Sourcepub fn close(
&mut self,
reason: RealtimeCloseReason,
) -> Result<RealtimeSessionRecord, AgentError>
pub fn close( &mut self, reason: RealtimeCloseReason, ) -> Result<RealtimeSessionRecord, AgentError>
Close. This journals close intent/result and calls the realtime adapter to close the active session.
Trait Implementations§
Source§impl Clone for RealtimeSessionController
impl Clone for RealtimeSessionController
Source§fn clone(&self) -> RealtimeSessionController
fn clone(&self) -> RealtimeSessionController
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more