eventloop.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:ShadowSocks 作者: immqy 项目源码 文件源码
def __init__(self):
        if hasattr(select, 'epoll'):
            self._impl = select.epoll()
            model = 'epoll'
        elif hasattr(select, 'kqueue'):
            self._impl = KqueueLoop()
            model = 'kqueue'
        elif hasattr(select, 'select'):
            self._impl = SelectLoop()
            model = 'select'
        else:
            raise Exception('can not find any available functions in select '
                            'package')
        self._fdmap = {}  # (f, handler)
        self._last_time = time.time()
        self._periodic_callbacks = []
        self._stopping = False
        logging.debug('using event model: %s', model)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号