Small server lifespan helper for startup and shutdown state.
A lifespan can be registered as:
- a one-arity function receiving the server and returning a map,
{:ok, map},{map, cleanup}, or{:ok, map, cleanup} - an explicit
{enter_fun, exit_fun}pair
Startup results are merged in declaration order, with later lifespans winning on key conflicts. Cleanup runs in reverse order.
Summary
Functions
Runs the collected cleanup callbacks.
Builds a new value for this module from the supplied options.
Runs all configured lifespan enter hooks and collects cleanup callbacks.