Class: Qpid::Proton::Reactor::Container Deprecated

Inherits:
Container
  • Object
show all
Defined in:
lib/reactor/container.rb

Overview

Deprecated.

use Container

Instance Attribute Summary

Attributes inherited from Container

#auto_stop, #handler, #id, #stopped

Instance Method Summary collapse

Methods inherited from Container

#connect_io, #inspect, #listen_io, #run, #running, #stop, #to_s, #work_queue

Constructor Details

#initialize(handlers, opts = nil) ⇒ Container

Deprecated.

use Container

Returns a new instance of Container.



32
33
34
35
36
37
# File 'lib/reactor/container.rb', line 32

def initialize(handlers, opts=nil)
  deprecated Qpid::Proton::Reactor::Container, Qpid::Proton::Container
  h = handlers || (opts && opts[:global_handler]) || Handler::ReactorMessagingAdapter.new(nil)
  id = opts && opts[:container_id]
  super(h, id)
end

Instance Method Details

#connect(opts = nil)

Raises:

  • (::ArgumentError.new)


42
43
44
45
46
# File 'lib/reactor/container.rb', line 42

def connect(opts=nil)
  url = opts && (opts[:url] || opts[:address])
  raise ::ArgumentError.new, "no :url or :address option provided" unless url
  super(url, opts)
end

#create_receiver(context, opts = nil)



59
60
61
62
63
64
65
66
67
68
# File 'lib/reactor/container.rb', line 59

def create_receiver(context, opts=nil)
  c = context if context.is_a? Qpid::Proton::Connection
  unless c
    url = Qpid::Proton::uri context
    c = super_connect(url, opts)
    opts ||= {}
    opts[:source] ||= url.amqp_address
  end
  c.open_receiver opts
end

#create_sender(context, opts = nil)



48
49
50
51
52
53
54
55
56
57
# File 'lib/reactor/container.rb', line 48

def create_sender(context, opts=nil)
  c = context if context.is_a? Qpid::Proton::Connection
  unless c
    url = Qpid::Proton::uri context
    c = super_connect(url, opts)
    opts ||= {}
    opts[:target] ||= url.amqp_address
  end
  c.open_sender opts
end

#listen(url, ssl_domain = nil)



70
71
72
73
# File 'lib/reactor/container.rb', line 70

def listen(url, ssl_domain = nil)
  # TODO aconway 2017-11-29: ssl_domain
  super(url)
end