@private
# File lib/handler/c_adaptor.rb, line 25 def initialize(handler, on_error = nil) @handler = handler @on_error = on_error end
# File lib/handler/c_adaptor.rb, line 30 def dispatch(cevent, ctype) event = Qpid::Proton::Event::Event.wrap(cevent, ctype) # TODO add a variable to enable this programmatically # print "EVENT: #{event} going to #{@handler}\n" event.dispatch(@handler) end
# File lib/handler/c_adaptor.rb, line 37 def exception(error) if @on_error.nil? raise error else @on_error.call(error) end end