pub struct SessionActivationRouter { /* private fields */ }Expand description
One router per owning runtime/AppState. All keys are logical Session ids.
Implementations§
Source§impl SessionActivationRouter
impl SessionActivationRouter
pub fn new() -> Arc<Self> ⓘ
Sourcepub async fn set_spawner(&self, spawner: Arc<dyn SessionActivationSpawner>)
pub async fn set_spawner(&self, spawner: Arc<dyn SessionActivationSpawner>)
Late-bind the real server/SDK reservation adapter after its dependency graph has been assembled.
Sourcepub fn set_inbox(&self, inbox: Arc<dyn SessionInboxPort>)
pub fn set_inbox(&self, inbox: Arc<dyn SessionInboxPort>)
Bind the durable inbox used by abandoned-run reconciliation.
Sourcepub async fn register_run(
self: &Arc<Self>,
target_session_id: &str,
run_id: &str,
) -> Result<SessionRunRegistration, SessionRunRegistrationError>
pub async fn register_run( self: &Arc<Self>, target_session_id: &str, run_id: &str, ) -> Result<SessionRunRegistration, SessionRunRegistrationError>
Register an execution created by any entry point. The returned receiver is a safe-point wake signal; the loop also drains the durable inbox at every round boundary, so missed/coalesced notifications do not lose data.
Sourcepub async fn attach_delivery_sink(
&self,
target_session_id: &str,
sink: UnboundedSender<u64>,
) -> Option<String>
pub async fn attach_delivery_sink( &self, target_session_id: &str, sink: UnboundedSender<u64>, ) -> Option<String>
Bind an external actor driver to the current logical-session owner.
Returns the active run id used to correlate every forwarded claim and confirmation. A pending generation is pushed immediately, closing the delivery-before-bind race without making this in-memory signal durable.
Sourcepub async fn detach_delivery_sink(&self, target_session_id: &str, run_id: &str)
pub async fn detach_delivery_sink(&self, target_session_id: &str, run_id: &str)
Remove a driver only when it still belongs to the same activation run. A stale driver can therefore never unbind its successor.
Sourcepub async fn owns_run(&self, target_session_id: &str, run_id: &str) -> bool
pub async fn owns_run(&self, target_session_id: &str, run_id: &str) -> bool
True only while this exact activation run remains the logical owner.
Sourcepub async fn begin_finalization(&self, target_session_id: &str, run_id: &str)
pub async fn begin_finalization(&self, target_session_id: &str, run_id: &str)
Mark the current run as finalizing before its runner slot becomes
available. Deliveries racing this interval are retained in
latest_generation and handed to one successor by
finish_finalization.
Sourcepub async fn finish_finalization(
&self,
target_session_id: &str,
run_id: &str,
admitted_generation: u64,
) -> Result<Option<SessionActivationDisposition>, SessionActivationError>
pub async fn finish_finalization( &self, target_session_id: &str, run_id: &str, admitted_generation: u64, ) -> Result<Option<SessionActivationDisposition>, SessionActivationError>
Release the terminal owner and, if the durable transcript cursor is behind a concurrently delivered inbox generation, reserve and launch exactly one successor using the injected real runtime adapter.
pub async fn subscribe(&self, target_session_id: &str) -> Receiver<u64>
Trait Implementations§
Source§impl Clone for SessionActivationRouter
impl Clone for SessionActivationRouter
Source§fn clone(&self) -> SessionActivationRouter
fn clone(&self) -> SessionActivationRouter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more