Skip to content

Commit e74ab78

Browse files
authored
feat(server): add method to get number of watching connection (#185)
1 parent 9ac0dfe commit e74ab78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server/graceful.rs

+5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ impl GracefulShutdown {
6868
// and then wait for all of them to complete
6969
tx.closed().await;
7070
}
71+
72+
/// Returns the number of the watching connections.
73+
pub fn count(&self) -> usize {
74+
self.tx.receiver_count()
75+
}
7176
}
7277

7378
impl Debug for GracefulShutdown {

0 commit comments

Comments
 (0)