Class: RSwim::Member::TransmissionState::Ready

Inherits:
Base
  • Object
show all
Defined in:
lib/rswim/member/transmission_state/ready.rb

Instance Method Summary collapse

Methods inherited from Base

#enqueue_ping, #enqueue_ping_from, #enqueue_ping_request, #prepare_output

Constructor Details

#initialize(id, node_member_id, member_pool, source_ids = [], target_ids = []) ⇒ Ready

Returns a new instance of Ready.



7
8
9
# File 'lib/rswim/member/transmission_state/ready.rb', line 7

def initialize(id, node_member_id, member_pool, source_ids = [], target_ids = [])
  super
end

Instance Method Details

#advance(_elapsed_seconds) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/rswim/member/transmission_state/ready.rb', line 15

def advance(_elapsed_seconds)
  if !@source_ids.empty?
    SendingPing.new(@id, @node_member_id, @member_pool, @source_ids, @target_ids)
  elsif !@target_ids.empty?
    SendingPingRequest.new(@id, @node_member_id, @member_pool, @source_ids, @target_ids)
  else
    self
  end
end

#member_replied_with_ackObject



11
12
13
# File 'lib/rswim/member/transmission_state/ready.rb', line 11

def member_replied_with_ack
  logger.debug("out of order ack from member #{@id}")
end