Redis did not respect QoS settings. (ask/celery #355)

This commit is contained in:
Ask Solem 2011-03-27 14:06:54 +02:00
parent 2e0169d404
commit 079b4a06ff
2 changed files with 3 additions and 2 deletions

View File

@ -100,7 +100,8 @@ class MultiChannelPoller(object):
for fileno, event in events:
if event & eventio.POLL_READ:
chan, type = self._fd_to_chan[fileno]
return chan.handlers[type](), self
if chan.qos.can_consume():
return chan.handlers[type](), self
elif event & eventio.POLL_HUP:
chan, type = self._fd_to_chan[fileno]
chan._poll_error(type)

View File

@ -89,7 +89,7 @@ class QoS(object):
"""
pcount = self.prefetch_count
return (not pcount or len(self._delivered) - len(self._dirty) < pcount)
return not pcount or len(self._delivered) - len(self._dirty) < pcount
def append(self, message, delivery_tag):
"""Append message to transactional state."""