mirror of https://github.com/celery/kombu.git
Updates Changelog
This commit is contained in:
parent
baaaf3604f
commit
7b706c40ab
19
Changelog
19
Changelog
|
@ -2,6 +2,25 @@
|
|||
Change history
|
||||
================
|
||||
|
||||
.. _version-2.1.0:
|
||||
|
||||
2.1.0
|
||||
=====
|
||||
:release-date: 2012-02-03 17:00 P.M GMT
|
||||
:by: Ask Solem
|
||||
|
||||
* MongoDB: Now supports fanout (broadcast) (Issue #98).
|
||||
|
||||
Contributed by Scott Lyons
|
||||
|
||||
* pika transport: Now works with pika 0.9.5 and 0.9.6dev.
|
||||
|
||||
The old pika transport (supporting 0.5.x) is now available
|
||||
as alias ``oldpika``.
|
||||
|
||||
(Note terribly latency has been experienced with the new pika
|
||||
versions, so this is still an experimental transport).
|
||||
|
||||
.. _version-2.0.0:
|
||||
|
||||
2.0.0
|
||||
|
|
|
@ -96,6 +96,36 @@ def itermessages(conn, channel, queue, limit=1, timeout=None,
|
|||
|
||||
|
||||
def eventloop(conn, limit=None, timeout=None, ignore_timeouts=False):
|
||||
"""Best practice generator wrapper around ``Connection.drain_events``.
|
||||
|
||||
Able to drain events forever, with a limit, and optionally ignoring
|
||||
timeout errors (a timeout of 1 is often used in environments where
|
||||
the socket can get "stuck", and is a best practice for Kombu consumers).
|
||||
|
||||
**Examples**
|
||||
|
||||
``eventloop`` is a generator::
|
||||
|
||||
>>> from kombu.common import eventloop
|
||||
|
||||
>>> it = eventloop(connection, timeout=1, ignore_timeouts=True)
|
||||
>>> it.next() # one event consumed, or timed out.
|
||||
|
||||
>>> for _ in eventloop(connection, timeout=1, ignore_timeouts=True):
|
||||
... pass # loop forever.
|
||||
|
||||
It also takes an optional limit parameter, and timeout errors
|
||||
are propagated by default::
|
||||
|
||||
for _ in eventloop(connection, limit=1, timeout=1):
|
||||
pass
|
||||
|
||||
.. seealso::
|
||||
|
||||
:func:`itermessages`, which is an event loop bound to one or more
|
||||
consumers, that yields any messages received.
|
||||
|
||||
"""
|
||||
for i in limit and xrange(limit) or count():
|
||||
try:
|
||||
yield conn.drain_events(timeout=timeout)
|
||||
|
|
|
@ -40,7 +40,7 @@ TRANSPORT_ALIASES = {
|
|||
"amqplib": "kombu.transport.amqplib.Transport",
|
||||
"librabbitmq": "kombu.transport.librabbitmq.Transport",
|
||||
"pika": "kombu.transport.pika2.Transport",
|
||||
"syncpika": "kombu.transport.pika.SyncTransport",
|
||||
"oldpika": "kombu.transport.pika.SyncTransport",
|
||||
"memory": "kombu.transport.memory.Transport",
|
||||
"redis": "kombu.transport.redis.Transport",
|
||||
"SQS": "kombu.transport.SQS.Transport",
|
||||
|
|
Loading…
Reference in New Issue