class Qpid::Proton::Sender

The sending endpoint.

@see Receiver

Public Instance Methods

delivery_tag() click to toggle source
# File lib/core/sender.rb, line 67
def delivery_tag
  @tag_count ||= 0
  result = @tag_count.succ
  @tag_count = result
  return "#{result}"
end
offered(n) click to toggle source

Signals the availability of deliveries.

@param n [Fixnum] The number of deliveries potentially available.

# File lib/core/sender.rb, line 38
def offered(n)
  Cproton.pn_link_offered(@impl, n)
end
send(object, tag = nil) click to toggle source

Sends the specified data to the remote endpoint.

@param object [Object] The content to send. @param tag [Object] The tag

@return [Fixnum] The number of bytes sent.

# File lib/core/sender.rb, line 49
def send(object, tag = nil)
  if object.respond_to? :proton_send
    object.proton_send(self, tag)
  else
    stream(object)
  end
end
stream(bytes) click to toggle source

Send the specified bytes as part of the current delivery.

@param bytes [Array] The bytes to send.

@return n [Fixnum] The number of bytes sent.

# File lib/core/sender.rb, line 63
def stream(bytes)
  Cproton.pn_link_send(@impl, bytes)
end