Class: RSwim::Member::TransmissionState::SendingPing

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

Instance Method Summary collapse

Methods inherited from Base

#enqueue_ping, #enqueue_ping_from, #enqueue_ping_request

Constructor Details

#initialize(id, node_member_id, member_pool, source_ids, target_ids) ⇒ SendingPing

Returns a new instance of SendingPing.



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

def initialize(id, node_member_id, member_pool, source_ids, target_ids)
  super
  @done = false
end

Instance Method Details

#advance(_elapsed_seconds) ⇒ Object



16
17
18
19
20
# File 'lib/rswim/member/transmission_state/sending_ping.rb', line 16

def advance(_elapsed_seconds)
  if @done then AwaitingAck.new(@id, @node_member_id, @member_pool, @source_ids, @target_ids)
  else self
  end
end

#member_replied_with_ackObject



12
13
14
# File 'lib/rswim/member/transmission_state/sending_ping.rb', line 12

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

#prepare_outputObject



22
23
24
25
26
# File 'lib/rswim/member/transmission_state/sending_ping.rb', line 22

def prepare_output
  @done = true
  message = Message.new(@id, @node_member_id, :ping)
  [message]
end