Add a signal for notifying when a registry is populating.
Review Request #10070 — Created July 5, 2018 and submitted — Latest diff uploaded
This introduces a
registry_populating
signal, which allows code to
lazily register entries in the registry during its population phase.
This prevents an application from having to register custom entries at
some point in its initialization process, or to try to guess a good time
to do so before the registry might be used. Applications can simply
listen to this signal and register when fired.The signal provides the usual
sender
argument, which is the class of
the registry, and aregistry
argument for the instance. To be truly
effective, subclasses ofRegistry
,EntryPointRegistry
, etc. should
be used, so that thesender
can always point to something specific.
Djblets and Review Board unit tests pass.
Tested with some new code in Review Board that uses this signal instead
of populating on initialization. Confirmed that the signal fired at the
appropriate time and the new information was registered.