gurumitts / pylutron-caseta

Apache License 2.0
153 stars 97 forks source link

Switch to using asyncio.timeout instead of asyncio.wait_for #138

Closed bdraco closed 1 year ago

bdraco commented 1 year ago

asyncio.wait_for creates a task whereas asyncio.timeout avoids doing this which decreases latency.

Fallback to using async_timeout when the python version is too old (<3.11)

asyncio.timeout will become the underlying implementation for async.wait_for in cpython 3.12 https://github.com/python/cpython/pull/98518

bdraco commented 1 year ago

thanks