Scrapy, a fast high-level web crawling & scraping framework for Python.
Document that signal handler order is undefined (#7941)
Adrian5b4888a0b1e3
diff --git a/docs/topics/item-pipeline.rst b/docs/topics/item-pipeline.rstindex c1313635c..35891ce8e 100644--- a/docs/topics/item-pipeline.rst+++ b/docs/topics/item-pipeline.rst@@ -49,7 +49,8 @@ Additionally, they may also implement the following methods:.. method:: close_spider(self)- This method is called when the spider is closed.+ This method is called when the spider is closed, before the+ :signal:`spider_closed` signal is sent.Any of these methods may be defined as a coroutine function (``async def``).diff --git a/docs/topics/signals.rst b/docs/topics/signals.rstindex f7f9f5cca..ceea2f7c0 100644--- a/docs/topics/signals.rst+++ b/docs/topics/signals.rst@@ -44,6 +44,15 @@ Here is a simple example showing how you can catch signals and perform some actidef parse(self, response):pass+.. _signal-order:++Handler order+=============++The order in which the handlers of a signal run is undefined, and+:ref:`asynchronous handlers <signal-deferred>` run concurrently. If two actions+must happen in a given order, run both from a single handler, in that order.+.. _signal-deferred:Asynchronous signal handlers