lib/kazoo/broker.rb
# Returns a list of all partitions that are currently led by this broker.
Returns a list of all partitions that are currently led by this broker.
Returns a list of all partitions that are currently led by this broker .
def led_partitions
      result, mutex = [], Mutex.new
      threads = cluster.partitions.map do |partition|
        Thread.new do
          Thread.abort_on_exception = true
          select = partition.leader == self
          mutex.synchronize { result << partition } if select
        end
      end
      threads.each(&:join)
      result
    end
def led_partitions result , mutex = [ ] , Mutex . new threads = cluster . partitions . map do | partition | Thread . new do Thread . abort_on_exception = true select = partition . leader == self mutex . synchronize { result << partition } if select end end threads . each ( & :join ) result end
Returns a list of all partitions that are currently led by this broker.
Returns a list of all partitions that are currently led by this broker .