Class: Qpid::Proton::Sender
- Includes:
- Util::ErrorHandler
- Defined in:
- lib/core/sender.rb
Overview
The sending endpoint.
Constant Summary
Constants inherited from Link
Link::PROTON_METHOD_PREFIX, 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
Constants included from Util::Deprecation
Util::Deprecation::DEPRECATE_FULL_TRACE, Util::Deprecation::MATCH_DIR
Instance Attribute Summary collapse
-
#auto_settle ⇒ Boolean
readonly
Auto_settle flag, see #open.
Attributes inherited from Link
#available, #credit, #name, #queued, #receiver?, #remote_credit, #sender?, #state
Attributes included from Util::Wrapper
Instance Method Summary collapse
-
#delivery_tag ⇒ Object
deprecated
Deprecated.
internal use only
-
#offered(n) ⇒ Object
Hint to the remote receiver about the number of messages available.
-
#open(opts = nil) ⇒ Object
Open the Sender link.
-
#send(message) ⇒ Tracker
Send a message.
-
#stream(bytes) ⇒ Object
deprecated
Deprecated.
use #send
Methods included from Util::ErrorHandler
#can_raise_error, #check_for_error, #create_exception_handler_wrapper, included
Methods inherited from Link
#==, #_local_condition, #_remote_condition, #advance, #close, #connection, #current, #delivery, #detach, #drained, #error, #next, #rcv_settle_mode, #rcv_settle_mode=, #remote_source, #remote_target, #session, #snd_settle_mode, #snd_settle_mode=, #source, #target, wrap
Methods included from Util::Wrapper
included, #inspect, registry, #to_s
Methods inherited from Endpoint
#check_state, #closed?, #condition, #local_closed?, #local_condition, #local_open?, #local_uninit?, #open?, #remote_closed?, #remote_condition, #remote_open?, #remote_uninit?, #transport, #work_queue
Methods included from Util::Deprecation
deprecated, #deprecated, included
Instance Attribute Details
#auto_settle ⇒ Boolean (readonly)
Returns auto_settle flag, see #open.
52 53 54 |
# File 'lib/core/sender.rb', line 52 def auto_settle @auto_settle end |
Instance Method Details
#delivery_tag ⇒ Object
internal use only
89 |
# File 'lib/core/sender.rb', line 89 def delivery_tag() deprecated(__method__); next_tag; end |
#offered(n) ⇒ Object
Hint to the remote receiver about the number of messages available. The receiver may use this to optimize credit flow, or may ignore it.
57 58 59 |
# File 'lib/core/sender.rb', line 57 def offered(n) Cproton.pn_link_offered(@impl, n) end |
#open_sender(address) ⇒ Object #open_sender(opts) ⇒ Object
Open the Qpid::Proton::Sender link
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/core/sender.rb', line 40 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.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/core/sender.rb', line 67 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) ⇒ Object
use #send
83 84 85 86 |
# File 'lib/core/sender.rb', line 83 def stream(bytes) deprecated __method__, "send" Cproton.pn_link_send(@impl, bytes) end |