add size()

This commit is contained in:
chrislu
2024-03-15 20:34:39 -07:00
parent 6f615c62ae
commit 64a32730a2
2 changed files with 14 additions and 0 deletions

View File

@@ -54,3 +54,10 @@ func (p *LocalPartitionSubscribers) IsEmpty() bool {
return len(p.Subscribers) == 0
}
func (p *LocalPartitionSubscribers) Size() int {
p.SubscribersLock.RLock()
defer p.SubscribersLock.RUnlock()
return len(p.Subscribers)
}