lib/cztop/patterns/bstar.rb
def read_state
    while @statesub.readable?
      msg = @statesub.receive
      @peer_expiry = Time.now + 2 * @heartbeat
      case msg[0]
      when "BSTAR"
        peer_state = msg[1].to_sym

        # NOTE could only raise DualPassives and SplitBrain
        fsm(Events.event_for(peer_state))
      else
        # FIXME
        warn "weird state message: #{msg.inspect}"
      end
    end
  rescue IO::EAGAINWaitReadable
    # queue has been emptied
  end
# Read all pending state messages from the other peer.
# @return [void]
Read all pending state messages from the other peer.
Read all pending state messages from the other peer .
def read_state
    while @statesub.readable?
      msg = @statesub.receive
      @peer_expiry = Time.now + 2 * @heartbeat
      case msg[0]
      when "BSTAR"
        peer_state = msg[1].to_sym
        fsm(Events.event_for(peer_state))
      else
        warn "weird state message: #{msg.inspect}"
      end
    end
  rescue IO::EAGAINWaitReadable
  end
def read_state while @statesub . readable? msg = @statesub . receive @peer_expiry = Time . now + 2 * @heartbeat case msg [ 0 ] when "BSTAR" peer_state = msg [ 1 ] . to_sym fsm ( Events . event_for ( peer_state ) ) else warn "weird state message: #{msg.inspect}" end end rescue IO :: EAGAINWaitReadable end
Read all pending state messages from the other peer.
Read all pending state messages from the other peer .
# NOTE could only raise DualPassives and SplitBrain # FIXME # queue has been emptied
None
void