Skip to content

Commit

Permalink
src: stats: Add hub stats pub interface
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Sep 16, 2024
1 parent 928410e commit 1e8f825
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/stats/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ impl Stats {
response_rx.await?
}

pub async fn hub_stats(&mut self) -> Result<StatsInner> {
let (response_tx, response_rx) = oneshot::channel();
self.sender
.send(StatsCommand::GetHubStats {
response: response_tx,
})
.await?;
response_rx.await?
}

pub async fn set_period(&mut self, period: tokio::time::Duration) -> Result<()> {
let (response_tx, response_rx) = oneshot::channel();
self.sender
Expand Down

0 comments on commit 1e8f825

Please sign in to comment.