Class Qpid::Proton::Receiver
In: lib/core/receiver.rb
Parent: Link

The receiving endpoint.

@see Sender

Methods

flow   open   receive  

Included Modules

Util::Wrapper

Constants

PROTON_METHOD_PREFIX = "pn_link"   @private

Attributes

auto_accept  [R]  @return [Boolean] auto_accept flag, see {open}
credit_window  [R]  @return [Integer] credit window, see {open}

Public Instance methods

Grants credit for incoming deliveries.

@param n [Integer] The amount to increment the link credit.

Open {Receiver} link

@overload open_receiver(address)

  @param address [String] address of the source to receive from

@overload open_receiver(opts)

  @param opts [Hash] Receiver options, see {Receiver#open}
  @option opts [Integer] :credit_window automatically maintain this much credit
    for messages to be pre-fetched while the current message is processed.
  @option opts [Boolean] :auto_accept if true, deliveries that are not settled by
    the application in {MessagingHandler#on_message} are automatically accepted.
  @option opts [Boolean] :dynamic (false) dynamic property for source {Terminus#dynamic}
  @option opts [String,Hash] :source source address or source options, see {Terminus#apply}
  @option opts [String,Hash] :target target address or target options, see {Terminus#apply}
  @option opts [String] :name (generated) unique name for the link.

Allows receiving up to the specified limit of data from the remote endpoint.

Note that large messages can be streamed across the network, so just because there is no data to read does not imply the message is complete.

To ensure the entirety of the message data has been read, either call receive until nil is returned, or verify that partial? is false and Delivery#pending is 0.

@param limit [Integer] The maximum bytes to receive.

@return [Integer, nil] The number of bytes received, or nil if the end of the stream was reached.

@see Deliver#pending To see how much buffer space is needed.

@raise [LinkError] If an error occurs.

[Validate]