Class: Qwirk::Adapter::Inline::Publisher::MyResponseHandle

Inherits:
Object
  • Object
show all
Defined in:
lib/qwirk/adapter/inline/publisher.rb

Instance Method Summary collapse

Constructor Details

#initializeMyResponseHandle

Returns a new instance of MyResponseHandle.



7
8
9
# File 'lib/qwirk/adapter/inline/publisher.rb', line 7

def initialize
  @responses = []
end

Instance Method Details

#add(original_message_id, response_message, worker_name) ⇒ Object



11
12
13
# File 'lib/qwirk/adapter/inline/publisher.rb', line 11

def add(original_message_id, response_message, worker_name)
  @responses << [original_message_id, response_message, worker_name]
end

#timeout_read(timeout) ⇒ Object

We’re inline so we either have a response or not (not is interpreted as a timeout)



16
17
18
# File 'lib/qwirk/adapter/inline/publisher.rb', line 16

def timeout_read(timeout)
  @responses.pop
end