Package proton :: Module reactor :: Class Container

[frames] | no frames]

# Class Container

source code

         object --+
                  |
    wrapper.Wrapper --+
                      |
                Reactor --+
                          |
                         Container

A representation of the AMQP concept of a 'container', which lossely speaking is something that establishes links to or from another container, over which messages are transfered. This is an extension to the Reactor class that adds convenience methods for creating connections and sender- or receiver- links.

Instance Methods

__init__(self, *handlers, **kwargs) x.__init__(...) initializes x; see help(type(x)) for signature | source code

connect(self, url=None, urls=None, address=None, handler=None, reconnect=None, heartbeat=None, ssl_domain=None) Initiates the establishment of an AMQP connection. | source code

create_sender(self, context, target=None, source=None, name=None, handler=None, tags=None, options=None) Initiates the establishment of a link over which messages can be sent. | source code

create_receiver(self, context, source=None, target=None, name=None, dynamic=False, handler=None, options=None) Initiates the establishment of a link over which messages can be received (aka a subscription). | source code

declare_transaction(self, context, handler=None, settle_before_discharge=False) | source code

listen(self, url, ssl_domain=None) Initiates a server socket, accepting incoming AMQP connections on the interface and port specified. | source code

do_work(self, timeout=None) | source code

Inherited from `Reactor`: `acceptor`, `connection`, `mark`, `on_error`, `process`, `push_event`, `run`, `schedule`, `selectable`, `start`, `stop`, `update`, `wakeup`, `yield_`

Inherited from `wrapper.Wrapper`: `__del__`, `__delattr__`, `__eq__`, `__getattr__`, `__hash__`, `__ne__`, `__repr__`, `__setattr__`

Inherited from `object`: `__format__`, `__getattribute__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods
Inherited from `Reactor`: `wrap`

Properties
Inherited from `Reactor`: `global_handler`, `handler`, `quiesced`, `timeout` Inherited from `object`: `__class__`

Method Details

### __init__(self, *handlers, **kwargs)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
  (inherited documentation)

### connect(self, url=None, urls=None, address=None, handler=None, reconnect=None, heartbeat=None, ssl_domain=None)

source code

Initiates the establishment of an AMQP connection. Returns an instance of proton.Connection.

### create_sender(self, context, target=None, source=None, name=None, handler=None, tags=None, options=None)

source code

Initiates the establishment of a link over which messages can be sent. Returns an instance of proton.Sender.

There are two patterns of use. (1) A connection can be passed as the first argument, in which case the link is established on that connection. In this case the target address can be specified as the second argument (or as a keyword argument). The source address can also be specified if desired. (2) Alternatively a URL can be passed as the first argument. In this case a new connection will be establised on which the link will be attached. If a path is specified and the target is not, then the path of the URL is used as the target address.

The name of the link may be specified if desired, otherwise a unique name will be generated.

Various LinkOptions can be specified to further control the attachment.

### create_receiver(self, context, source=None, target=None, name=None, dynamic=False, handler=None, options=None)

source code

Initiates the establishment of a link over which messages can be received (aka a subscription). Returns an instance of proton.Receiver.

There are two patterns of use. (1) A connection can be passed as the first argument, in which case the link is established on that connection. In this case the source address can be specified as the second argument (or as a keyword argument). The target address can also be specified if desired. (2) Alternatively a URL can be passed as the first argument. In this case a new connection will be establised on which the link will be attached. If a path is specified and the source is not, then the path of the URL is used as the target address.

The name of the link may be specified if desired, otherwise a unique name will be generated.

Various LinkOptions can be specified to further control the attachment.