Home AssistantHome AssistantContributors
In code
async_hass.async_add_executor_job
Also
asyncio, executor

Functions that start with async_ run in the event loop and must never block. Code that can only block, like a library without async support, runs in an executor thread with hass.async_add_executor_job.