pub struct SessionsService { /* private fields */ }Expand description
Hosts the cross-window SessionsRegistry as a DaemonService.
Implementations§
Source§impl SessionsService
impl SessionsService
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates the service with an empty registry. Cheap — no I/O and no task;
the daemon calls start_watcher to begin the
transcript watcher, while tests use the bare service.
Sourcepub fn with_journal_dir(self, dir: PathBuf) -> Self
pub fn with_journal_dir(self, dir: PathBuf) -> Self
Reads the hook journals under dir (see
crate::sessions::journal): replayed at startup and tailed while the
daemon runs, once start_watcher starts the task.
Sourcepub fn start_watcher(&self)
pub fn start_watcher(&self)
Starts the engine-owned transcript watcher (Feed 2): a background task
that scans ~/.claude/projects/**/*.jsonl for new/growing transcripts and
feeds the registry, so a session started before the daemon — or working
through the hook-silent thinking window — is still discovered and marked
active. Alongside it runs the Codex rollout watcher (#1909), which
discovers Codex sessions from $CODEX_HOME/sessions/ and ends archived
or killed ones. Idempotent, and a no-op outside a tokio runtime (mirroring the
worktrees menu-refresh and Snowflake keep-alive tasks), so unit tests that
build a bare service start no watcher.
Trait Implementations§
Source§impl DaemonService for SessionsService
impl DaemonService for SessionsService
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
service field) and to label its status/menu.Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
op: &'life1 str,
payload: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
op: &'life1 str,
payload: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn subscribe(
&self,
op: &str,
_payload: &Value,
) -> Option<Box<dyn ServiceStream>>
fn subscribe( &self, op: &str, _payload: &Value, ) -> Option<Box<dyn ServiceStream>>
None when
op is not one this service streams (the default for every service). Read moremenu,
identified by its MenuAction::id.Source§fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
daemon status aggregation.Source§fn credit_accept_outage(&self, outage: Duration)
fn credit_accept_outage(&self, outage: Duration)
outage
(descriptor exhaustion, #2111), so no client could have reached this
service for that long. Read moreAuto Trait Implementations§
impl !Freeze for SessionsService
impl !RefUnwindSafe for SessionsService
impl !UnwindSafe for SessionsService
impl Send for SessionsService
impl Sync for SessionsService
impl Unpin for SessionsService
impl UnsafeUnpin for SessionsService
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
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