You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mc...@apache.org on 2014/11/10 14:15:29 UTC

qpid-proton git commit: PROTON-739: Add TTL to Ruby Messenger subscribe method.

Repository: qpid-proton
Updated Branches:
  refs/heads/master 89cbc9cec -> bdeaf3470


PROTON-739: Add TTL to Ruby Messenger subscribe method.

By default the TTL is 0, mimicking the behavior of the underlying C
code.

Patch by: Dominic Evanss <do...@uk.ibm.com>
          (Tweaked slightly by me)


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

Branch: refs/heads/master
Commit: bdeaf34708408eb7cf15a437584462a61107aaf1
Parents: 89cbc9c
Author: Darryl L. Pierce <mc...@apache.org>
Authored: Mon Nov 10 07:34:26 2014 -0500
Committer: Darryl L. Pierce <mc...@apache.org>
Committed: Mon Nov 10 08:13:49 2014 -0500

----------------------------------------------------------------------
 proton-c/bindings/ruby/lib/qpid_proton/messenger.rb | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bdeaf347/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb b/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
index dfc5717..3dca86c 100644
--- a/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
+++ b/proton-c/bindings/ruby/lib/qpid_proton/messenger.rb
@@ -207,13 +207,19 @@ module Qpid
       # domain portion of the address begins with the '~' character, the
       # Messenger will interpret the domain as host/port, bind to it,
       # and listen for incoming messages. For example "~0.0.0.0",
-      # "amqp://~0.0.0.0" will all bind to any local interface and 
-      # listen for incoming messages.  Ad address of # "amqps://~0.0.0.0" 
+      # "amqp://~0.0.0.0" will all bind to any local interface and
+      # listen for incoming messages.  An address of "amqps://~0.0.0.0"
       # will only permit incoming SSL connections.
       #
-      def subscribe(address)
+      # ==== Options
+      #
+      # * address - the source address to be subscribe
+      # * timeout - an optional time-to-live value, in seconds, for the
+      #             subscription
+      #
+      def subscribe(address, timeout=0)
         raise TypeError.new("invalid address: #{address}") if address.nil?
-        subscription = Cproton.pn_messenger_subscribe(@impl, address)
+        subscription = Cproton.pn_messenger_subscribe_ttl(@impl, address, timeout)
         raise Qpid::Proton::ProtonError.new("Subscribe failed") if subscription.nil?
         Qpid::Proton::Subscription.new(subscription)
       end


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