Closed genismoreno closed 1 month ago
You could always create a callable object instead, e.g.
class EngineStopped:
def __init__(self, lazy):
self.lazy = lazy
def __call__(self, *args, **kwargs):
... # Use self.lazy
crawler.signals.connect(receiver=EngineStopped(lazy=True), signal=signals.engine_stopped)
is this issue resolved or can I work on it? @Gallaecio @genismoreno @
@genismoreno Feel free to reopen if you find a scenario where the solution above is not good enough.
I think that with the solution @Gallaecio proposed should be enough. Thank you!!
Summary
Allow passing parameters to a signal receiver (when self is not available)
I.e.
Motivation
Pass of parameters to the receiver method would allow more dependent logic/behavior in it