pub struct GithubCountersService { /* private fields */ }Expand description
Periodically logs, and reports on demand, the GitHub API-call counters.
Implementations§
Source§impl GithubCountersService
impl GithubCountersService
Sourcepub fn new() -> Self
pub fn new() -> Self
Cheap construction (like the worktrees/sessions services): captures the
start time and the request log’s current extent, reads none of its
records, and persists nothing. Call Self::start_counter_logger to
spawn the periodic task once inside the tokio runtime.
Sourcepub fn start_counter_logger(&self)
pub fn start_counter_logger(&self)
Spawns the ~5s-then-every-10-min summary task. Idempotent and a no-op outside a tokio runtime (unit tests), mirroring the worktrees pollers.
Trait Implementations§
Source§impl DaemonService for GithubCountersService
impl DaemonService for GithubCountersService
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier used to route control-socket envelopes to this service
(the envelope’s
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,
Handles an operation routed to this service, returning a JSON payload.
Cheap snapshot of the service’s tray submenu, polled by the menu-bar
shell. Must not block.
Performs a tray menu action previously surfaced by
menu,
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,
Structured status for
daemon status aggregation.Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gracefully stops the service, draining in-flight work. Called once on
daemon shutdown.
Source§fn subscribe(
&self,
_op: &str,
_payload: &Value,
) -> Option<Box<dyn ServiceStream>>
fn subscribe( &self, _op: &str, _payload: &Value, ) -> Option<Box<dyn ServiceStream>>
Opens a push subscription for a streaming op, or returns
None when
op is not one this service streams (the default for every service). Read moreSource§fn credit_accept_outage(&self, _outage: Duration)
fn credit_accept_outage(&self, _outage: Duration)
Told that the control socket could not accept connections for
outage
(descriptor exhaustion, #2111), so no client could have reached this
service for that long. Read moreAuto Trait Implementations§
impl !Freeze for GithubCountersService
impl RefUnwindSafe for GithubCountersService
impl Send for GithubCountersService
impl Sync for GithubCountersService
impl Unpin for GithubCountersService
impl UnsafeUnpin for GithubCountersService
impl UnwindSafe for GithubCountersService
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