Package proton :: Module handlers :: Class MessagingHandler

[frames] | no frames]

# Class MessagingHandler

source code

    object --+
             |
       Handler --+
                 |
    object --+   |
             |   |
        Acking --+
                 |
                MessagingHandler

Known Subclasses:
  - TransactionalClientHandler
  - , utils.Fetcher

A general purpose handler that makes the proton-c events somewhat simpler to deal with and/or avoids repetitive tasks for common use cases.

Instance Methods

__init__(self, prefetch=10, auto_accept=True, auto_settle=True, peer_close_is_error=False) x.__init__(...) initializes x; see help(type(x)) for signature | source code

on_transport_error(self, event) Called when some error is encountered with the transport over which the AMQP connection is to be established. | source code

on_connection_error(self, event) Called when the peer closes the connection with an error condition. | source code

on_session_error(self, event) Called when the peer closes the session with an error condition. | source code

on_link_error(self, event) Called when the peer closes the link with an error condition. | source code

on_reactor_init(self, event) Called when the event loop - the reactor - starts. | source code

on_start(self, event) Called when the event loop starts. | source code

on_connection_closed(self, event) Called when the connection is closed. | source code

on_session_closed(self, event) Called when the session is closed. | source code

on_link_closed(self, event) Called when the link is closed. | source code

on_connection_closing(self, event) Called when the peer initiates the closing of the connection. | source code

on_session_closing(self, event) Called when the peer initiates the closing of the session. | source code

on_link_closing(self, event) Called when the peer initiates the closing of the link. | source code

on_disconnected(self, event) Called when the socket is disconnected. | source code

on_sendable(self, event) Called when the sender link has credit and messages can therefore be transferred. | source code

on_accepted(self, event) Called when the remote peer accepts an outgoing message. | source code

on_rejected(self, event) Called when the remote peer rejects an outgoing message. | source code

on_released(self, event) Called when the remote peer releases an outgoing message. | source code

on_settled(self, event) Called when the remote peer has settled the outgoing message. | source code

on_message(self, event) Called when a message is received. | source code

Inherited from `Handler`: `on_unhandled` Inherited from `Acking`: `accept`, `reject`, `release`, `settle` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, prefetch=10, auto_accept=True, auto_settle=True, peer_close_is_error=False)
(Constructor)

source code

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

Overrides: object.__init__
  (inherited documentation)

### on_transport_error(self, event)

source code

Called when some error is encountered with the transport over which the AMQP connection is to be established. This includes authentication errors as well as socket errors.

### on_start(self, event)

source code

Called when the event loop starts. (Just an alias for on_reactor_init)

### on_released(self, event)

source code

Called when the remote peer releases an outgoing message. Note that this may be in response to either the RELEASE or MODIFIED state as defined by the AMQP specification.

### on_settled(self, event)

source code

Called when the remote peer has settled the outgoing message. This is the point at which it shouod never be retransmitted.

### on_message(self, event)

source code

Called when a message is received. The message itself can be obtained as a property on the event. For the purpose of refering to this message in further actions (e.g. if explicitly accepting it, the ``delivery`` should be used, also obtainable via a property on the event.