From 9e76c5897a24412adc0bf66d4409fa876c3418d6 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 18 Feb 2020 19:53:13 +0100 Subject: [PATCH] Add warning for call async function from a thread (#409) * Add warning for call async function from a thread * Update docs/asyncio_working_with_async.md Co-Authored-By: Aaron Bach Co-authored-by: Paulus Schoutsen Co-authored-by: Aaron Bach --- docs/asyncio_working_with_async.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/asyncio_working_with_async.md b/docs/asyncio_working_with_async.md index db9bdaed..833c54f3 100644 --- a/docs/asyncio_working_with_async.md +++ b/docs/asyncio_working_with_async.md @@ -90,6 +90,8 @@ async def async_say_hello(hass, target): return f"Hello {target}!" ``` +**Warning:** be careful with this! If the async function uses executor jobs, it can lead to a deadlock. + ## Calling sync functions from async If you are running inside an async context, it might sometimes be necessary to call a sync function. Do this like this: