MCPcopy
hub / github.com/django/django / SignalHandler

Class SignalHandler

tests/asgi/tests.py:39–47  ·  view source on GitHub ↗

Helper class to track threads and kwargs when signals are dispatched.

Source from the content-addressed store, hash-verified

37
38
39class SignalHandler:
40 """Helper class to track threads and kwargs when signals are dispatched."""
41
42 def __init__(self):
43 super().__init__()
44 self.calls = []
45
46 def __call__(self, signal, **kwargs):
47 self.calls.append({"thread": threading.current_thread(), "kwargs": kwargs})
48
49
50@override_settings(ROOT_URLCONF="asgi.urls")

Calls

no outgoing calls