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 <[email protected]> (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/examples Commit: bdeaf34708408eb7cf15a437584462a61107aaf1 Parents: 89cbc9c Author: Darryl L. Pierce <[email protected]> Authored: Mon Nov 10 07:34:26 2014 -0500 Committer: Darryl L. Pierce <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
