Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: change sync-to-thread-info.rst wording about sync_to_thread #3799

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/admonitions/sync-to-thread-info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading