Module: MessageObject

Defined in:
lib/message-object/version.rb,
lib/message-object/communication.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#get_response(destination, timeout = 30) ⇒ Object



13
14
15
16
17
# File 'lib/message-object/communication.rb', line 13

def get_response(destination, timeout = 30)
  response_queue = @message_object_queue_manager.find_queue(destination)
  fail "#{destination} queue not found" if response_queue.nil?
  response_queue.get_message_payload(timeout)
end

#send_request(target, return_destination, message) ⇒ Object



6
7
8
9
10
11
# File 'lib/message-object/communication.rb', line 6

def send_request(target, return_destination, message)
  request_queue = @message_object_queue_manager.find_queue(target)
  fail "#{target} queue not found" if request_queue.nil?

  request_queue.put_message(message.to_s, return_destination)
end

#set_queue_manager(queue_manager) ⇒ Object



2
3
4
# File 'lib/message-object/communication.rb', line 2

def set_queue_manager(queue_manager)
  @message_object_queue_manager = queue_manager
end