Module: Qpid::Proton::Util::Handler

Included in:
Handler::WrappedHandler, Reactor::Reactor
Defined in:
lib/util/handler.rb

Instance Method Summary collapse

Instance Method Details

#chandler(handler, on_error) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/util/handler.rb', line 25

def chandler(handler, on_error)
  return nil if handler.nil?

  if handler.instance_of?(Qpid::Proton::Handler::WrappedHandler)
    impl = handler.impl
    Cproton.pn_incref(impl)
    return impl
  else
    cadaptor = Qpid::Proton::Handler::CAdaptor.new(handler, on_error)
    rbhandler = Cproton.pn_rbhandler(cadaptor)
    return rbhandler
  end
end