summaryrefslogtreecommitdiff
path: root/kombu/asynchronous/hub.py
diff options
context:
space:
mode:
Diffstat (limited to 'kombu/asynchronous/hub.py')
-rw-r--r--kombu/asynchronous/hub.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/kombu/asynchronous/hub.py b/kombu/asynchronous/hub.py
index a8c3124f..7cc6e35f 100644
--- a/kombu/asynchronous/hub.py
+++ b/kombu/asynchronous/hub.py
@@ -254,6 +254,14 @@ class Hub(object):
for callback in self.on_close:
callback(self)
+ # Complete remaining todo before Hub close
+ # Eg: Acknowledge message
+ # To avoid infinite loop where one of the callables adds items
+ # to self._ready (via call_soon or otherwise).
+ # we create new list with current self._ready
+ for item in list(self._ready):
+ item()
+
def _discard(self, fd):
fd = fileno(fd)
self.readers.pop(fd, None)