Skip to content

Commit eb8ae4a

Browse files
committedMar 19, 2025·
feat: expose connection count
1 parent bd76282 commit eb8ae4a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎src/manager.rs

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ impl Manager {
8282
tracing::warn!("unexpected event_ch ended prematurely on remove: {:?}", err);
8383
}
8484
}
85+
86+
pub fn is_empty(&self) -> bool {
87+
self.conns.is_empty()
88+
}
89+
90+
pub fn len(&self) -> usize {
91+
self.conns.len()
92+
}
8593
}
8694

8795
#[derive(Debug, Clone)]

‎src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const KEEP_ALIVE_INTERVAL: Duration = Duration::from_secs(45);
1919

2020
#[derive(Clone)]
2121
pub struct Server {
22-
manager: Manager,
22+
pub manager: Manager,
2323
}
2424

2525
pub type MessageStream = Pin<Box<dyn Stream<Item = proto::Message> + Send>>;

0 commit comments

Comments
 (0)
Please sign in to comment.