mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Warn that signal receivers are weakly-referenced
For the signal get_generators in particular, it may seem natural to use a lambda or inner function as the signal receiver, but this does not work as the receiver is collected before it can be called.
This commit is contained in:
parent
afe009e6c9
commit
e65d33b89c
1 changed files with 6 additions and 0 deletions
|
|
@ -57,6 +57,12 @@ which you map the signals to your plugin logic. Let's take a simple example::
|
|||
def register():
|
||||
signals.initialized.connect(test)
|
||||
|
||||
.. note::
|
||||
|
||||
Signal receivers are weakly-referenced and thus must not be defined within
|
||||
your ``register`` callable or they will be garbage-collected before the
|
||||
signal is emitted.
|
||||
|
||||
List of signals
|
||||
===============
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue