pub struct SessionActorHandle {
pub tx: Sender<SessionCommand>,
pub tx_out: Sender<SessionOutput>,
pub last_active: Instant,
pub cancel: CancellationToken,
pub resume_banner_sent: Arc<AtomicBool>,
pub pending_resume_banner: Option<Arc<str>>,
}Expand description
Bookkeeping handle for one live session, held by LiveSessionRegistry (spec §9.3).
Cheap to clone — tx/tx_out are Arc-backed channel senders.
Fields§
§tx: Sender<SessionCommand>Mailbox for SessionCommands; same-session prompts are serialized by this mpsc’s FIFO
ordering (spec §9.2 concurrency policy — no separate turn-lock needed).
tx_out: Sender<SessionOutput>Broadcast source new subscribers (SSE connections, TUI attach) subscribe to.
last_active: InstantUpdated by LiveSessionRegistry::get on every lookup; read by
LiveSessionRegistry::idle_candidates for TTL eviction.
cancel: CancellationTokenCancelling this token ends exactly this session’s actor gracefully — the same effect as
sending SessionCommand::Shutdown, but usable without an owned mpsc permit. What
serve.evict idle eviction (spec §9.3) calls to target one session without affecting any
other live actor. Distinct from the process-wide TaskSupervisor cancellation token.
Resume-banner single-emission guard (spec-068 §13.5, AC-24): when more than one
display-owning channel attaches to the same live session, exactly one attach must
render the banner. Arc-shared across every Clone of this handle so all attach
paths observe the same flag. Use Self::claim_resume_banner rather than reading
this directly.
Resume-visibility banner text, computed once at session build time (spec-068 §13.5,
AC-24) from the session’s replayed history. None when [session.resume] show_banner = false or the session had no prior history to resume. Rendered by exactly one
attach path, gated by Self::claim_resume_banner — see GET /sessions/:id/events
(events_session_handler, src/serve/handlers.rs) for the sole production consumer.
Implementations§
Source§impl SessionActorHandle
impl SessionActorHandle
Atomically claim the right to render the resume banner for this session.
Returns true for exactly one caller across all attach paths sharing this handle
(via Clone) — that caller renders the banner; every other caller (this attach or
any subsequent one) gets false and must render nothing (spec-068 §13.5, AC-24).
Trait Implementations§
Source§impl Clone for SessionActorHandle
impl Clone for SessionActorHandle
Source§fn clone(&self) -> SessionActorHandle
fn clone(&self) -> SessionActorHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SessionActorHandle
impl !UnwindSafe for SessionActorHandle
impl Freeze for SessionActorHandle
impl Send for SessionActorHandle
impl Sync for SessionActorHandle
impl Unpin for SessionActorHandle
impl UnsafeUnpin for SessionActorHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request