X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=python-eventlet%2Feventlet%2Fgreen%2Fselectors.py;h=81fc8628cfba38883772435956a39acca69c1b5f;hb=refs%2Fchanges%2F91%2F17791%2F1;hp=26427ec187108efec9aa9725c69d8bf9d189a325;hpb=358bd9258c2b6d2ee74de4dfd07a5123107abad4;p=packages%2Ftrusty%2Fpython-eventlet.git diff --git a/python-eventlet/eventlet/green/selectors.py b/python-eventlet/eventlet/green/selectors.py index 26427ec..81fc862 100644 --- a/python-eventlet/eventlet/green/selectors.py +++ b/python-eventlet/eventlet/green/selectors.py @@ -3,9 +3,32 @@ import sys from eventlet import patcher from eventlet.green import select +__patched__ = [ + 'DefaultSelector', + 'SelectSelector', +] + +# We only have green select so the options are: +# * leave it be and have selectors that block +# * try to pretend the "bad" selectors don't exist +# * replace all with SelectSelector for the price of possibly different +# performance characteristic and missing fileno() method (if someone +# uses it it'll result in a crash, we may want to implement it in the future) +# +# This module used to follow the third approach but just removing the offending +# selectors is less error prone and less confusing approach. +__deleted__ = [ + 'PollSelector', + 'EpollSelector', + 'DevpollSelector', + 'KqueueSelector', +] + patcher.inject('selectors', globals(), ('select', select)) del patcher if sys.platform != 'win32': SelectSelector._select = staticmethod(select.select) + +DefaultSelector = SelectSelector