Skip to content

Commit 0bfdab7

Browse files
committed
feat: spiders use uvloop/winloop when available
1 parent d5b9ed1 commit 0bfdab7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scrapling/spiders/spider.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,7 @@ def start(self, backend_options: Dict[str, Any] | None = None) -> CrawlResult:
203203
204204
:param backend_options: Asyncio backend options to be used with `anyio.run`
205205
"""
206+
backend_options = backend_options or {}
207+
# By default use the faster uvloop/winloop event loop implementation, if available
208+
backend_options.update({"use_uvloop": True})
206209
return anyio.run(self.__run, backend="asyncio", backend_options=backend_options)

0 commit comments

Comments
 (0)