pub struct RuntimeState {
pub web_viewer: ViewerControl,
/* private fields */
}Fields§
§web_viewer: ViewerControlImplementations§
Source§impl RuntimeState
impl RuntimeState
pub async fn prepare_move_session( self: &Arc<Self>, selection: MoveSelection, ) -> Result<MovePreparation>
pub async fn move_session( self: &Arc<Self>, request: MoveSessionRequest, ) -> Result<MoveOutcome>
Source§impl RuntimeState
impl RuntimeState
Sourcepub fn review_host(&self) -> &TurnReviewHost
pub fn review_host(&self) -> &TurnReviewHost
The review host, for the surfaces that project and resolve reviews.
pub fn allocate_revision(&self) -> u64
pub fn publish_web_access(&self, access: WebViewerAccess)
pub fn revisions(&self) -> Receiver<u64>
Sourcepub fn with_config<T>(&self, read: impl FnOnce(&Config) -> T) -> T
pub fn with_config<T>(&self, read: impl FnOnce(&Config) -> T) -> T
Read the config the daemon serves right now. A task on a schedule reads it again on every tick, so a reload reaches it without a restart.
Sourcepub async fn create_quick_bundle(
&self,
source: String,
) -> Result<QuickBundleCreation, QuickBundleFailure>
pub async fn create_quick_bundle( &self, source: String, ) -> Result<QuickBundleCreation, QuickBundleFailure>
Create a bundle under the daemon’s config-mutation coordinator. The controller helper also takes the cross-process config lock, so a TUI transaction cannot race this one while the daemon’s other config writers are excluded by this mutex.
pub async fn reload_controller(&self) -> Result<()>
Sourcepub async fn start_subagent_session(
self: &Arc<Self>,
request: RegisterSubagentRequest,
) -> Result<SubagentRecord>
pub async fn start_subagent_session( self: &Arc<Self>, request: RegisterSubagentRequest, ) -> Result<SubagentRecord>
Register and start a child worker on its parent’s existing target.
pub async fn start_create_session_controlled( self: &Arc<Self>, request: CreateSessionRequest, control: CreateSessionControl, publication: Receiver<Result<(), String>>, ) -> Result<RegisteredSession>
pub async fn wait_create_session(&self, session_id: &str) -> Result<()>
pub fn request_close(&self, session_id: &str)
pub fn clear_close_request(&self, session_id: &str)
pub fn close_is_requested(&self, session_id: &str) -> bool
pub async fn close_session(self: &Arc<Self>, session_id: String) -> Result<()>
Sourcepub async fn resume_session(
self: &Arc<Self>,
request: ResumeSessionRequest,
) -> Result<()>
pub async fn resume_session( self: &Arc<Self>, request: ResumeSessionRequest, ) -> Result<()>
Resume a session, and return nothing.
This used to answer with the whole MaterializedSession. That reply
travels as one JSON frame against MAX_FRAME_BYTES, so a session whose
projection outgrew 8 MiB could not be resumed at all — it built a
several-hundred-megabyte buffer and then refused to send it. The
projection is already durable; a viewer reads it from the store.
Sourcepub async fn force_destroy_session(
self: &Arc<Self>,
session_id: String,
) -> Result<()>
pub async fn force_destroy_session( self: &Arc<Self>, session_id: String, ) -> Result<()>
Permanently destroy a session from any state, cancelling whatever
lifecycle operation holds it first. Data loss is the caller’s confirmed
decision; see Controller::force_destroy_session.
Sourcepub async fn force_delete_workspace(
self: &Arc<Self>,
workspace_id: String,
) -> Result<()>
pub async fn force_delete_workspace( self: &Arc<Self>, workspace_id: String, ) -> Result<()>
Force-delete a workspace: destroy every active session in it (see
RuntimeState::force_destroy_session), drop its detached drafts, and
remove the workspace row. Stopped histories stay globally resumable.
In-flight resumes into the workspace still refuse the deletion because they have not yet claimed a durable session workspace. A session that fails to destroy stops the sequence with the remainder named, so the operation can be retried without losing progress.
Sourcepub fn active_lifecycles(&self) -> Vec<RuntimeLifecycleView>
pub fn active_lifecycles(&self) -> Vec<RuntimeLifecycleView>
Every lifecycle operation running now.
The dashboard receives these through a watch channel built by its own poller, which the phone server does not have; rather than plumb that channel through the session-manager handle, the phone loop reads the same state directly. The read is a mutex acquisition over a small map, and it happens once per published snapshot, so it never blocks the loop the way an await on the async snapshot path would.
Sourcepub fn session_state(&self, session_id: &str) -> Option<SessionState>
pub fn session_state(&self, session_id: &str) -> Option<SessionState>
The lifecycle state of one in-memory record, or None when the daemon
holds no record for it. Reading one field costs one lock rather than a
clone of every record, which is what a poll wants.
Sourcepub fn session_record(&self, session_id: &str) -> Option<SessionRecord>
pub fn session_record(&self, session_id: &str) -> Option<SessionRecord>
One in-memory session record, or None when the daemon holds none.
pub async fn workspace_session_handle( &self, session_id: &str, ) -> Result<ManagedSessionHandle>
Sourcepub async fn checkpoint_session_now(
&self,
session_id: &str,
) -> Result<CheckpointMetadata>
pub async fn checkpoint_session_now( &self, session_id: &str, ) -> Result<CheckpointMetadata>
Checkpoint a session now and publish the result, the way the daemon’s own checkpoint action does.
The API’s bundle export needs a fresh archive for a running session, and it must take the same lifecycle guard and controller refresh as any other checkpoint rather than driving the controller behind their backs.
Sourcepub fn session_projection(
&self,
) -> (BTreeMap<String, SessionRecord>, Vec<RuntimeLifecycleView>)
pub fn session_projection( &self, ) -> (BTreeMap<String, SessionRecord>, Vec<RuntimeLifecycleView>)
In-memory records and ownership sampled with the same lock order as completion. A web publish must not pair old records with a new absence of ownership, even while its background database reload is in flight.
pub fn cancel_lifecycle_if_active(&self, session_id: &str)
Auto Trait Implementations§
impl !Freeze for RuntimeState
impl !RefUnwindSafe for RuntimeState
impl !UnwindSafe for RuntimeState
impl Send for RuntimeState
impl Sync for RuntimeState
impl Unpin for RuntimeState
impl UnsafeUnpin for RuntimeState
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> 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 more