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.



905
906
907
# File 'lib/march_hare/channel.rb', line 905

def initialize(block)
  @block = block
end

Class Method Details

.from(block) ⇒ Object



901
902
903
# File 'lib/march_hare/channel.rb', line 901

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

Instance Method Details

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



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

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