Connect a receiver function to a signal. The signal can be any object, although Scrapy comes with some predefined signals that are documented in the :ref:`topics-signals` section. :param receiver: the function to be connected :type receiver: collect
(self, receiver: Any, signal: Any, **kwargs: Any)
| 16 | self.sender: Any = sender |
| 17 | |
| 18 | def connect(self, receiver: Any, signal: Any, **kwargs: Any) -> None: |
| 19 | """ |
| 20 | Connect a receiver function to a signal. |
| 21 | |
| 22 | The signal can be any object, although Scrapy comes with some |
| 23 | predefined signals that are documented in the :ref:`topics-signals` |
| 24 | section. |
| 25 | |
| 26 | :param receiver: the function to be connected |
| 27 | :type receiver: collections.abc.Callable |
| 28 | |
| 29 | :param signal: the signal to connect to |
| 30 | :type signal: object |
| 31 | """ |
| 32 | kwargs.setdefault("sender", self.sender) |
| 33 | dispatcher.connect(receiver, signal, **kwargs) |
| 34 | |
| 35 | def disconnect(self, receiver: Any, signal: Any, **kwargs: Any) -> None: |
| 36 | """ |