class RSwim::Member::Me

Public Class Methods

new(id) click to toggle source
Calls superclass method RSwim::Member::Base::new
# File lib/rswim/member/me.rb, line 6
def initialize(id)
  super
  @ack_responder = AckResponder.new(id)
  @incarnation_number = 0
  @propagation_count = 0
end

Public Instance Methods

can_be_pinged?() click to toggle source
# File lib/rswim/member/me.rb, line 40
def can_be_pinged?
  false
end
increment_propagation_count() click to toggle source
# File lib/rswim/member/me.rb, line 30
def increment_propagation_count
  @propagation_count += 1
end
prepare_output() click to toggle source
# File lib/rswim/member/me.rb, line 17
def prepare_output
  @ack_responder.prepare_output
end
prepare_update_entry() click to toggle source
# File lib/rswim/member/me.rb, line 34
def prepare_update_entry
  UpdateEntry.new(@id, :alive, @incarnation_number, @propagation_count)
end
schedule_ack(member_id) click to toggle source
# File lib/rswim/member/me.rb, line 13
def schedule_ack(member_id)
  @ack_responder.schedule_ack(member_id)
end
update(elapsed_seconds) click to toggle source
# File lib/rswim/member/me.rb, line 38
def update(elapsed_seconds); end
update_suspicion(status, incarnation_number) click to toggle source
# File lib/rswim/member/me.rb, line 21
def update_suspicion(status, incarnation_number)
  if status != :alive && incarnation_number == @incarnation_number
    @incarnation_number += 1

    # making sure to get priority in being propagated
    @propagation_count = -10
  end
end