[#5793] added subscriptions.Broker.TotalClients() method

This commit is contained in:
Gani Georgiev
2024-11-04 19:16:25 +02:00
parent f9a2d6c6ae
commit 755149c915
3 changed files with 22 additions and 0 deletions

View File

@@ -30,6 +30,11 @@ func (b *Broker) ChunkedClients(chunkSize int) [][]Client {
return list.ToChunks(b.store.Values(), chunkSize)
}
// TotalClients returns the total number of registered clients.
func (b *Broker) TotalClients() int {
return b.store.Length()
}
// ClientById finds a registered client by its id.
//
// Returns non-nil error when client with clientId is not registered.