4.1.20 on_run_level(Hook, Prio)

-spec on_run_level(fun((enter | leave,
                        run_level()) -> _),
                   classy_hook:conf()) -> classy_hook:hook().

Register a hook that is executed on change of the run level of the local site.

When run level increases, hooks with higher priority run earlier; when it decreases, hooks run in the reverse order.

WARNING: if the callback interacts with the OTP application controller (e.g. it starts or stops an OTP application), then stopping classy application using application:stop(classy) will lead to a deadlock. Use classy:stop_system() function to safely lower the run level and shut down classy.

JavaScript license information