Method: Kazoo::Broker#replicated_partitions
- Defined in:
- lib/kazoo/broker.rb
#replicated_partitions ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kazoo/broker.rb', line 24 def replicated_partitions result, threads, mutex = [], ThreadGroup.new, Mutex.new cluster.partitions.each do |partition| t = Thread.new do select = partition.replicas.include?(self) mutex.synchronize { result << partition } if select end threads.add(t) end threads.list.each(&:join) result end |