Class: RSwim::Member::AckResponder

Inherits:
Object
  • Object
show all
Defined in:
lib/rswim/member/ack_responder.rb

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ AckResponder

Returns a new instance of AckResponder.



6
7
8
9
# File 'lib/rswim/member/ack_responder.rb', line 6

def initialize(id)
  @id = id
  @pending = []
end

Instance Method Details

#prepare_outputObject



15
16
17
18
19
# File 'lib/rswim/member/ack_responder.rb', line 15

def prepare_output
  result = @pending
  @pending = []
  result
end

#schedule_ack(member_id) ⇒ Object



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

def schedule_ack(member_id)
  @pending << Message.new(member_id, @id, :ack)
end