Class: MarchHare::Channel::BlockReturnListener

Inherits:
Object
  • Object
show all
Defined in:
lib/march_hare/channel.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ BlockReturnListener

Returns a new instance of BlockReturnListener.



915
916
917
# File 'lib/march_hare/channel.rb', line 915

def initialize(block)
  @block = block
end

Class Method Details

.from(block) ⇒ Object



911
912
913
# File 'lib/march_hare/channel.rb', line 911

def self.from(block)
  new(block)
end

Instance Method Details

#handleReturn(reply_code, reply_text, exchange, routing_key, basic_properties, payload) ⇒ Object



919
920
921
922
# File 'lib/march_hare/channel.rb', line 919

def handleReturn(reply_code, reply_text, exchange, routing_key, basic_properties, payload)
  # TODO: convert properties to a Ruby hash
  @block.call(reply_code, reply_text, exchange, routing_key, basic_properties, String.from_java_bytes(payload))
end