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.



925
926
927
# File 'lib/march_hare/channel.rb', line 925

def initialize(block)
  @block = block
end

Class Method Details

.from(block) ⇒ Object



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

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

Instance Method Details

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



929
930
931
932
# File 'lib/march_hare/channel.rb', line 929

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