From 2305719870f80eb7d984f9217b5be3d0a4839e08 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 15 Oct 2024 19:31:40 +0300 Subject: [PATCH] docs: change `sync-to-thread-info.rst` wording about `sync_to_thread` (#3799) --- docs/admonitions/sync-to-thread-info.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/admonitions/sync-to-thread-info.rst b/docs/admonitions/sync-to-thread-info.rst index 6b13a0b063..fe9329aa5a 100644 --- a/docs/admonitions/sync-to-thread-info.rst +++ b/docs/admonitions/sync-to-thread-info.rst @@ -7,8 +7,11 @@ running the event loop, and in turn block the whole application. To mitigate this, the ``sync_to_thread`` parameter can be set to ``True``, which - will result in the function being run in a thread pool. Should the function be - non-blocking, ``sync_to_thread`` should be set to ``False`` instead. + will result in the function being run in a thread pool. + + If a synchronous function is non-blocking, setting ``sync_to_thread`` to ``False`` + will tell Litestar that the user is sure about its behavior + and the function can be treated as non-blocking. If a synchronous function is passed, without setting an explicit ``sync_to_thread`` value, a warning will be raised.