'Handle any messages associated with this Transport.
This method clears a single message from the externally monitored
file descriptor by issuing a read call to the self.r file descriptor
which removes a single \'0\' character that was placed into the pipe
by the Qpid session message callback handler. Once a \'0\' is read,
all available events are drained through a call to
:meth:`drain_events`.
The file descriptor self.r is modified to be non-blocking, ensuring
that an accidental call to this method when no more messages will
not cause indefinite blocking.
Nothing is expected to be returned from :meth:`drain_events` because
:meth:`drain_events` handles messages by calling callbacks that are
maintained on the :class:`~kombu.transport.qpid.Connection` object.
When :meth:`drain_events` returns, all associated messages have been
handled.
This method calls drain_events() which reads as many messages as are
available for this Transport, and then returns. It blocks in the
sense that reading and handling a large number of messages may take
time, but it does not block waiting for a new message to arrive. When
:meth:`drain_events` is called a timeout is not specified, which
causes this behavior.
One interesting behavior of note is where multiple messages are
ready, and this method removes a single \'0\' character from
self.r, but :meth:`drain_events` may handle an arbitrary amount of
messages. In that case, extra \'0\' characters may be left on self.r
to be read, where messages corresponding with those \'0\' characters
have already been handled. The external epoll loop will incorrectly
think additional data is ready for reading, and will call
on_readable unnecessarily, once for each \'0\' to be read. Additional
calls to :meth:`on_readable` produce no negative side effects,
and will eventually clear out the symbols from the self.r file
descriptor. If new messages show up during this draining period,
they will also be properly handled.
:param connection: The connection associated with the readable
events, which contains the callbacks that need to be called for
the readable objects.
:type connection: kombu.transport.qpid.Connection
:param loop: The asynchronous loop object that contains epoll like
functionality.
:type loop: kombu.async.Hub'

def on_readable(self, connection, loop):

    os.read(self.r, 1)
    try:
        self.drain_events(connection)
    except socket.timeout:
        pass
