mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-06 14:31:57 +02:00
add size()
This commit is contained in:
1 parent
6f615c62ae
commit
64a32730a2
2 files changed
+14
No files matched your search
@@ -50,3 +50,10 @@ func (p *LocalPartitionPublishers) IsEmpty() bool {
|
||||
|
||||
return len(p.publishers) == 0
|
||||
}
|
||||
|
||||
func (p *LocalPartitionPublishers) Size() int {
|
||||
p.publishersLock.RLock()
|
||||
defer p.publishersLock.RUnlock()
|
||||
|
||||
return len(p.publishers)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user