pub struct CaptureService { /* private fields */ }Expand description
Service that captures tmux pane output and broadcasts to transport.
Implementations§
Source§impl CaptureService
impl CaptureService
Sourcepub async fn register_session(&self, repo: &str, task_id: &str, session: &str)
pub async fn register_session(&self, repo: &str, task_id: &str, session: &str)
Register a session to be tracked.
Sourcepub async fn unregister_session(&self, repo: &str, task_id: &str)
pub async fn unregister_session(&self, repo: &str, task_id: &str)
Unregister a session (stop tracking).
Sourcepub async fn start(&self)
pub async fn start(&self)
Start the capture loop.
This runs indefinitely, polling registered sessions for new output.
Sourcepub async fn run(&self)
pub async fn run(&self)
Run the capture loop while there are registered sessions.
This returns when no more sessions are registered, making it suitable for CLI streaming where the capture should stop when the session ends.
Sourcepub async fn get_silent_sessions_for_repo(
&self,
repo: &str,
grace_period: Duration,
) -> Vec<(String, String, i64)>
pub async fn get_silent_sessions_for_repo( &self, repo: &str, grace_period: Duration, ) -> Vec<(String, String, i64)>
Return task IDs of sessions that have been silent since registration.
A session is “silent” when:
- It has been registered for longer than
grace_period - It has NEVER produced any meaningful output (
has_output == false) - Either it was NEVER confirmed alive, OR it was seen alive but the tmux session is now dead (silent exit-0 case)
Condition (3) balances two cases:
- Session alive and working (tmux session exists, agent running, sparse output) → should NOT be killed; hard timeout will catch it if it runs too long (#2318)
- Session was alive but exited silently with no output (tmux session dead) → SHOULD trigger silence fallback within grace_period, not wait 30 min (#2573)
Returns (task_id, session_name, age_secs) for silent sessions.
Auto Trait Implementations§
impl !RefUnwindSafe for CaptureService
impl !UnwindSafe for CaptureService
impl Freeze for CaptureService
impl Send for CaptureService
impl Sync for CaptureService
impl Unpin for CaptureService
impl UnsafeUnpin for CaptureService
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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