class RSwim::Member::HealthState::Alive

Public Class Methods

new(id, member_pool, update_entry = UpdateEntry.new(id, :alive, 0, 0)) click to toggle source
Calls superclass method RSwim::Member::Base::new
# File lib/rswim/member/health_state/alive.rb, line 7
def initialize(id, member_pool, update_entry = UpdateEntry.new(id, :alive, 0, 0))
  super
  @failed_to_reply = false
end

Public Instance Methods

advance(_elapsed_seconds) click to toggle source
# File lib/rswim/member/health_state/alive.rb, line 12
def advance(_elapsed_seconds)
  if @failed_to_reply
    ue = UpdateEntry.new(@id, :suspected, @update_entry.incarnation_number, -1)
    Suspected.new(@id, @member_pool, ue, true)
  else
    self
  end
end
can_be_pinged?() click to toggle source
# File lib/rswim/member/health_state/alive.rb, line 25
def can_be_pinged?
  true
end
member_failed_to_reply() click to toggle source
# File lib/rswim/member/health_state/alive.rb, line 21
def member_failed_to_reply
  @failed_to_reply = true
end