From 9f7f71f5860999f7f336ace493c77d98201910b8 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Tue, 18 Jan 2011 12:03:38 +0100 Subject: [PATCH] kqueue accidentally disabled --- kombu/exceptions.py | 1 + kombu/utils/eventio.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kombu/exceptions.py b/kombu/exceptions.py index a6615748..9bd231fe 100644 --- a/kombu/exceptions.py +++ b/kombu/exceptions.py @@ -39,5 +39,6 @@ class ChannelLimitExceeded(LimitExceeded): """Maximum number of simultaenous channels exceeded.""" pass + class StdChannelError(Exception): pass diff --git a/kombu/utils/eventio.py b/kombu/utils/eventio.py index a23ad666..ba1c529b 100644 --- a/kombu/utils/eventio.py +++ b/kombu/utils/eventio.py @@ -32,7 +32,8 @@ class _kqueue(object): flags=flags)], 0) def poll(self, timeout): - kevents = self._kqueue.control(None, 1000, timeout / 1000.0) + kevents = self._kqueue.control(None, 1000, + timeout and timeout / 1000.0 or timeout) events = {} for kevent in kevents: fd = kevent.ident @@ -72,14 +73,13 @@ class _select(object): return events.items() if is_eventlet(select): - # Eventlet ships with a monkey patched version of select.select - # we can use. + # use Eventlet's non-blocking version of select.select poll = _select elif hasattr(select, "epoll"): # Py2.6+ Linux poll = select.epoll elif hasattr(select, "kqueue"): # Py2.6+ on BSD / Darwin - poll = select.poll + poll = _kqueue else: poll = _select