Class: Qpid::Proton::Handler::MessagingHandler Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/handler/messaging_handler.rb

Overview

Deprecated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ MessagingHandler #initialize(prefetch = 10, auto_accept = true, auto_settle = true, peer_close_is_error = false) ⇒ MessagingHandler

Deprecated.

use initialize(opts) overload

Returns a new instance of MessagingHandler.

Overloads:

  • #initialize(opts) ⇒ MessagingHandler

    Create a Qpid::Proton::Handler::MessagingHandler with options opts

    Options Hash (opts):

    • :prefetch (Integer) — default: 10

      The number of messages to fetch in advance, 0 disables prefetch.

    • :auto_accept (Boolean) — default: true

      If true, incoming messages are accepted automatically after #on_message. If false, the application can accept, reject or release the message by calling methods on Delivery when the message has been processed.

    • :auto_settle (Boolean) — default: true

      If true, outgoing messages are settled automatically when the remote peer settles. If false, the application must call Delivery#settle explicitly.

    • :auto_open (Boolean) — default: true

      If true, incoming connections are opened automatically. If false, the application must call Connection#open to open incoming connections.

    • :auto_close (Boolean) — default: true

      If true, respond to a remote close automatically with a local close. If false, the application must call Connection#close to finish closing connections.

    • :peer_close_is_error (Boolean) — default: false

      If true, and the remote peer closes the connection without an error condition, the set the local error condition Condition(“error”, “unexpected peer close”)



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/handler/messaging_handler.rb', line 53

def initialize(*args)
  deprecated MessagingHandler, Qpid::Proton::MessagingHandler
  @options = {}
  if args.size == 1 && args[0].is_a?(Hash)
    @options.replace(args[0])
  else                      # Fill options from deprecated fixed arguments
    [:prefetch, :auto_accept, :auto_settle, :peer_close_is_error].each do |k|
      opts[k] = args.shift unless args.empty?
    end
  end
  # NOTE: the options are processed by {Handler::Adapater}
end

Instance Attribute Details

#optionsHash (readonly)

Returns handler options, see #initialize.

Returns:



69
70
71
# File 'lib/handler/messaging_handler.rb', line 69

def options
  @options
end