diff options
author | Ask Solem <ask@celeryproject.org> | 2012-02-03 15:29:17 +0000 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2012-02-03 15:29:17 +0000 |
commit | 7b706c40abd8ef128e938acfdbf7b36d8838f1a3 (patch) | |
tree | 45a15d555e3af911ed304ebebe876f438dc0d2dd | |
parent | baaaf3604fa383296f4ba13e10c841345d835499 (diff) | |
download | kombu-7b706c40abd8ef128e938acfdbf7b36d8838f1a3.tar.gz |
Updates Changelog
-rw-r--r-- | Changelog | 19 | ||||
-rw-r--r-- | kombu/common.py | 30 | ||||
-rw-r--r-- | kombu/transport/__init__.py | 2 |
3 files changed, 50 insertions, 1 deletions
@@ -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 diff --git a/kombu/common.py b/kombu/common.py index 1fad8f8b..f16c3883 100644 --- a/kombu/common.py +++ b/kombu/common.py @@ -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) diff --git a/kombu/transport/__init__.py b/kombu/transport/__init__.py index 8414f329..f6f5f198 100644 --- a/kombu/transport/__init__.py +++ b/kombu/transport/__init__.py @@ -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", |