From 8263f5c7057c6fdb268f126019d7e0abc1067df3 Mon Sep 17 00:00:00 2001 From: Kelly Su Date: Mon, 10 Aug 2026 13:21:16 -0700 Subject: [PATCH] Use autofunction for inthread, drop reactor implementation note --- docs/topics/coroutines.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/topics/coroutines.rst b/docs/topics/coroutines.rst index f6d238b33..27a4dd32d 100644 --- a/docs/topics/coroutines.rst +++ b/docs/topics/coroutines.rst @@ -210,6 +210,7 @@ Scrapy from doing any other work while it runs. To avoid this, you can wrap the blocking call with :func:`~scrapy.utils.decorators.inthread`, which runs it in a separate thread and returns an awaitable with the result: +.. skip: next .. code-block:: python from scrapy.utils.decorators import inthread @@ -226,9 +227,7 @@ it in a separate thread and returns an awaitable with the result: result = await blocking_call(response.url) # ... use result to yield items and requests -:func:`~scrapy.utils.decorators.inthread` uses :func:`asyncio.to_thread` when -asyncio support is enabled, and Twisted's thread pool otherwise, so it works -regardless of which reactor your project uses. +.. autofunction:: scrapy.utils.decorators.inthread Common use cases for asynchronous code include: