Class: Qpid::Proton::Sender
Overview
The sending endpoint.
Constant Summary
Constants inherited from Link
Link::RCV_FIRST, Link::RCV_SECOND, Link::SND_MIXED, Link::SND_SETTLED, Link::SND_UNSETTLED
Constants inherited from Endpoint
Endpoint::LOCAL_ACTIVE, Endpoint::LOCAL_CLOSED, Endpoint::LOCAL_MASK, Endpoint::LOCAL_UNINIT, Endpoint::REMOTE_ACTIVE, Endpoint::REMOTE_CLOSED, Endpoint::REMOTE_MASK, Endpoint::REMOTE_UNINIT
Instance Attribute Summary collapse
-
#auto_settle ⇒ Boolean
readonly
Auto_settle flag, see #open.
Instance Method Summary collapse
-
#delivery_tag
deprecated
Deprecated.
internal use only
-
#offered(n)
Hint to the remote receiver about the number of messages available.
-
#open(opts = nil)
Open the Sender link.
-
#send(message) ⇒ Tracker
Send a message.
-
#stream(bytes)
deprecated
Deprecated.
use #send
Methods inherited from Link
#==, #advance, #close, #connection, #current, #delivery, #drained, #error, #next, #rcv_settle_mode, #rcv_settle_mode=, #remote_source, #remote_target, #session, #snd_settle_mode, #snd_settle_mode=, #source, #target
Methods inherited from Endpoint
#closed?, #local_closed?, #local_open?, #local_uninit?, #open?, #remote_closed?, #remote_open?, #remote_uninit?, #transport, #work_queue
Instance Attribute Details
#auto_settle ⇒ Boolean (readonly)
Returns auto_settle flag, see #open.
54 55 56 |
# File 'lib/core/sender.rb', line 54 def auto_settle @auto_settle end |
Instance Method Details
#delivery_tag
internal use only
91 |
# File 'lib/core/sender.rb', line 91 def delivery_tag() deprecated(__method__); next_tag; end |
#offered(n)
Hint to the remote receiver about the number of messages available. The receiver may use this to optimize credit flow, or may ignore it.
59 60 61 |
# File 'lib/core/sender.rb', line 59 def offered(n) Cproton.pn_link_offered(@impl, n) end |
#open_sender(address) #open_sender(opts)
Open the Qpid::Proton::Sender link
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/core/sender.rb', line 42 def open(opts=nil) opts = { :target => opts } if opts.is_a? String opts ||= {} target.apply opts[:target] source.apply opts[:source] target.dynamic = !!opts[:dynamic] @auto_settle = opts.fetch(:auto_settle, true) super() self end |
#send(message) ⇒ Tracker
Send a message.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/core/sender.rb', line 69 def send(, *args) tag = nil if args.size > 0 # deprecated: allow tag in args[0] for backwards compat raise ArgumentError("too many arguments") if args.size > 1 tag = args[0] end tag ||= next_tag t = Tracker.new(Cproton.pn_delivery(@impl, tag)) Cproton.pn_link_send(@impl, .encode) Cproton.pn_link_advance(@impl) t.settle if snd_settle_mode == SND_SETTLED return t end |
#stream(bytes)
use #send
85 86 87 88 |
# File 'lib/core/sender.rb', line 85 def stream(bytes) deprecated __method__, "send" Cproton.pn_link_send(@impl, bytes) end |