specter-desktop/docs/extensions/callbacks.md
k9ert 816726b935
Feature: Extension Framework upgrade incl. middleware, extensionsdependencies and -callbacks (#2186)
This PR brings the ability of having your own callbacks for extensions, depending on other extensions and callbacks now have a return_style either collect (default) or middleware
2023-02-11 11:21:31 +01:00

905 B

Callback methods

Callback methods will get called from within Specter Desktop Core for various reasons. You can implement them in your service-class in order to react on those occasions.

Checkout the cryptoadvance.specter.services.callbacks file for all the specific callbacks.

Some important one is the after_serverpy_init_app which passes a Scheduler class which can be used to setup regular tasks. A list of currently implemented callback-methods along with their descriptions are available in /src/cryptoadvance/specter/services/callbacks.py.

In the case of middleware, you can pass one object which will in turn passed to all extensions which registered that callback. Have a look at the adjust_view_model callback which is explained in detail in the frontend-section.