summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Koshelev <daevaorn@gmail.com>2014-03-02 21:19:13 +0400
committerAlex Koshelev <daevaorn@gmail.com>2014-03-02 21:19:13 +0400
commitf57a8d70927d52ea42ab6528745eb65e33a3d8b9 (patch)
treefe6e8b1c8838af2ad25478bdeb665ffb9ca18d92
parent32bab847775b612903d6605a364d7efd7e8815dc (diff)
downloadkombu-f57a8d70927d52ea42ab6528745eb65e33a3d8b9.tar.gz
Comments added
-rw-r--r--kombu/transport/mongodb.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/kombu/transport/mongodb.py b/kombu/transport/mongodb.py
index 8b3cb7dc..f6362190 100644
--- a/kombu/transport/mongodb.py
+++ b/kombu/transport/mongodb.py
@@ -31,6 +31,8 @@ DEFAULT_BROADCAST_COLLECTION = 'messages.broadcast'
class BroadcastCursor(object):
+ '''Cursor for broadcast queues.'''
+
def __init__(self, cursor):
# Fast forward the cursor past old events
self._cursor = cursor.skip(cursor.count())
@@ -246,6 +248,9 @@ class Channel(virtual.Channel):
try:
return self._broadcast_cursors[queue]
except KeyError:
+ # Cursor may be absent when Channel created more than one time.
+ # _fanout_queues is the class-level mutable attrbite so it is shared over all
+ # Channel instances.
return self.create_broadcast_cursor(self._fanout_queues[queue], None, None, queue)
def create_broadcast_cursor(self, exchange, routing_key, pattern, queue):