mirror of https://github.com/celery/kombu.git
kqueue accidentally disabled
This commit is contained in:
parent
df265a49aa
commit
9f7f71f586
|
@ -39,5 +39,6 @@ class ChannelLimitExceeded(LimitExceeded):
|
||||||
"""Maximum number of simultaenous channels exceeded."""
|
"""Maximum number of simultaenous channels exceeded."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class StdChannelError(Exception):
|
class StdChannelError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -32,7 +32,8 @@ class _kqueue(object):
|
||||||
flags=flags)], 0)
|
flags=flags)], 0)
|
||||||
|
|
||||||
def poll(self, timeout):
|
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 = {}
|
events = {}
|
||||||
for kevent in kevents:
|
for kevent in kevents:
|
||||||
fd = kevent.ident
|
fd = kevent.ident
|
||||||
|
@ -72,14 +73,13 @@ class _select(object):
|
||||||
return events.items()
|
return events.items()
|
||||||
|
|
||||||
if is_eventlet(select):
|
if is_eventlet(select):
|
||||||
# Eventlet ships with a monkey patched version of select.select
|
# use Eventlet's non-blocking version of select.select
|
||||||
# we can use.
|
|
||||||
poll = _select
|
poll = _select
|
||||||
elif hasattr(select, "epoll"):
|
elif hasattr(select, "epoll"):
|
||||||
# Py2.6+ Linux
|
# Py2.6+ Linux
|
||||||
poll = select.epoll
|
poll = select.epoll
|
||||||
elif hasattr(select, "kqueue"):
|
elif hasattr(select, "kqueue"):
|
||||||
# Py2.6+ on BSD / Darwin
|
# Py2.6+ on BSD / Darwin
|
||||||
poll = select.poll
|
poll = _kqueue
|
||||||
else:
|
else:
|
||||||
poll = _select
|
poll = _select
|
||||||
|
|
Loading…
Reference in New Issue