imapclient icon indicating copy to clipboard operation
imapclient copied to clipboard

Use defaultselector instead of select

Open NicolasLM opened this issue 8 years ago • 2 comments

On most systems, notably on Linux, select cannot work with file descriptors bigger than 1024.

If a user has many open sockets, even unrelated to IMAPClient, he won't be able to use idle_check.

We should use defaultselector instead. One issue is that this module is not available on Python 2.7.

We could either fallback to select for Python 2.7 or add a conditional dependency to selectors2.

NicolasLM avatar Aug 23 '17 14:08 NicolasLM

I'm definitely happy to get this sorted out using defaultselector where available. I think it's probably fine to fall back to select for Python 2.7. If it really becomes a problem for someone we can look at selectors2.

mjs avatar Aug 29 '17 09:08 mjs

I took a look at this because I thought it would just be some wrapper around imports and renaming (such as what we do with unittest.mock vs mock)

In fact, the selectors module has a different API than select and I never used them before so if someone with more knowledge around these things is motivated, don't be shy :)

mlorant avatar Oct 13 '17 22:10 mlorant