Functions | |
| Task[_T] | _T (Coroutine[Any, Any, _T] coro, *str|None name=None, AbstractEventLoop|None loop=None) |
| concurrent.futures.Future[_T] | _Ts (AbstractEventLoop loop, Callable[[*_Ts], _T] callback, **_Ts args) |
| bool | cancelling (Future[Any] task) |
| Any | gather_with_limited_concurrency (int limit, *Any tasks, bool return_exceptions=False) |
| list[TimerHandle] | get_scheduled_timer_handles (AbstractEventLoop loop) |
| None | shutdown_run_callback_threadsafe (AbstractEventLoop loop) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| string | _SHUTDOWN_RUN_CALLBACK_THREADSAFE = "_shutdown_run_callback_threadsafe" |
Asyncio utilities.
|
private |
| bool homeassistant.util.async_.cancelling | ( | Future[Any] | task | ) |
| Any homeassistant.util.async_.gather_with_limited_concurrency | ( | int | limit, |
| *Any | tasks, | ||
| bool | return_exceptions = False |
||
| ) |
| list[TimerHandle] homeassistant.util.async_.get_scheduled_timer_handles | ( | AbstractEventLoop | loop | ) |
| None homeassistant.util.async_.shutdown_run_callback_threadsafe | ( | AbstractEventLoop | loop | ) |
Call when run_callback_threadsafe should prevent creating new futures. We must finish all callbacks before the executor is shutdown or we can end up in a deadlock state where: `executor.result()` is waiting for its `._condition` and the executor shutdown is trying to `.join()` the executor thread. This function is considered irreversible and should only ever be called when Home Assistant is going to shutdown and python is going to exit.
|
private |