Show live background task counts
This commit is contained in:
1 parent
9fd21af4e8
commit
8262ceb786
16 files changed
+160
-29
No files matched your search
@@ -337,6 +337,14 @@ pub enum Event {
|
||||
id: String,
|
||||
answers: Vec<String>,
|
||||
},
|
||||
/// How many background tasks the provider says are alive now.
|
||||
///
|
||||
/// State rather than a transcript row: the phone draws it beside the
|
||||
/// session status. A distinct event keeps the count current while a
|
||||
/// session is open; `GET /sessions` supplies the opening snapshot.
|
||||
BackgroundTasks {
|
||||
count: usize,
|
||||
},
|
||||
Status {
|
||||
state: SessionStatus,
|
||||
},
|
||||
@@ -596,6 +604,12 @@ pub type EventSink = mpsc::UnboundedSender<Event>;
|
||||
/// with live input injects it at the next tool boundary, while a turn-at-a-time
|
||||
/// dialect queues it for the next child process.
|
||||
pub trait Driver: Send + Sync {
|
||||
/// The provider's latest measured number of live background tasks.
|
||||
/// `None` means it has not reported one, not that the count is zero.
|
||||
fn background_tasks(&self) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Takes a message, now or once the session is free for it.
|
||||
///
|
||||
/// Every driver owes exactly one `MessageTaken` per message, at the moment
|
||||
|
||||
Reference in new issue
Block a user