You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/06/18 23:58:02 UTC

[24/50] [abbrv] qpid-proton git commit: PROTON-781: Added support for reactors to the Ruby Endpoint class.

PROTON-781: Added support for reactors to the Ruby Endpoint class.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1ea85612
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1ea85612
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1ea85612

Branch: refs/heads/cjansen-cpp-client
Commit: 1ea856124ef91ce8cc643aca099c0a1809bec9f5
Parents: b7ee18c
Author: Darryl L. Pierce <mc...@gmail.com>
Authored: Thu Apr 16 10:41:08 2015 -0400
Committer: Darryl L. Pierce <mc...@gmail.com>
Committed: Thu Jun 18 16:28:44 2015 -0400

----------------------------------------------------------------------
 proton-c/bindings/ruby/lib/core/endpoint.rb | 25 ++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1ea85612/proton-c/bindings/ruby/lib/core/endpoint.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/endpoint.rb b/proton-c/bindings/ruby/lib/core/endpoint.rb
index cbf1015..f3ddbcb 100644
--- a/proton-c/bindings/ruby/lib/core/endpoint.rb
+++ b/proton-c/bindings/ruby/lib/core/endpoint.rb
@@ -110,6 +110,31 @@ module Qpid::Proton
       !(self.state & state_mask).zero?
     end
 
+    def handler
+      reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl))
+      if reactor.nil?
+        on_error = nil
+      else
+        on_error = reactor.method(:on_error)
+      end
+      record = self.attachments
+      puts "record=#{record}"
+      WrappedHandler.wrap(Cproton.pn_record_get_handler(record), on_error)
+    end
+
+    def handler=(handler)
+      reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl))
+      if reactor.nil?
+        on_error = nil
+      else
+        on_error = reactor.method(:on_error)
+      end
+      impl = chandler(handler, on_error)
+      record = self.attachments
+      Cproton.pn_record_set_handler(record, impl)
+      Cproton.pn_decref(impl)
+    end
+
   end
 
 end


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org