From 978b7c69ade69226ad81a65ff3c836e358f1f99d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 10 Mar 2024 08:41:46 -1000 Subject: [PATCH] Add blog post about all integrations importing in the executor (#2108) --- blog/2024-03-09-import_executor_default.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 blog/2024-03-09-import_executor_default.md diff --git a/blog/2024-03-09-import_executor_default.md b/blog/2024-03-09-import_executor_default.md new file mode 100644 index 00000000..b8bff12a --- /dev/null +++ b/blog/2024-03-09-import_executor_default.md @@ -0,0 +1,15 @@ +--- +author: J. Nick Koston +authorURL: https://github.com/bdraco +title: "Integrations import in the executor to avoid blocking the event loop" +--- + +Starting from Home Assistant 2024.4, all integrations are imported in the executor to avoid blocking the event loop while the code is imported and executed. + +In the rare event that an integration creates loop-bound objects at import time, this may fail because there is no running loop in the executor. + +Custom integrations needing more time to adjust their code to avoid creating such objects can opt-out and continue to have their code imported in the event loop, understanding that system stability will be impacted. + +To opt-out of importing in the executor, an integration can add: + +`"import_executor": false` to their [`manifest.json`](/docs/creating_integration_manifest) \ No newline at end of file