class RSwim::Member::HealthState::Suspected
Public Class Methods
new(id, member_pool, update_entry, send_ping_request)
click to toggle source
Calls superclass method
RSwim::Member::HealthState::Base::new
# File lib/rswim/member/health_state/suspected.rb, line 7 def initialize(id, member_pool, update_entry, send_ping_request) super(id, member_pool, update_entry) @ping_request_sent = !send_ping_request @life_time_seconds = 0 end
Public Instance Methods
advance(elapsed_seconds)
click to toggle source
# File lib/rswim/member/health_state/suspected.rb, line 13 def advance(elapsed_seconds) @life_time_seconds += elapsed_seconds unless @ping_request_sent @member_pool.send_ping_request_to_k_members(@id) @ping_request_sent = true end if @life_time_seconds > 60 Confirmed.new(@id, @member_pool, UpdateEntry.new(@id, :confirmed, @update_entry.incarnation_number, -2)) else self end end
can_be_pinged?()
click to toggle source
# File lib/rswim/member/health_state/suspected.rb, line 26 def can_be_pinged? true end