If the process dies, the Supervisor invokes the `terminate/2` callback so you're still able to process events.
Here are the relevant lines: https://github.com/plausible/analytics/blob/b724def948d51a0f...
Keep in mind you need to trap exit signal to tell the supervisor to invoke the callback, as done so here: https://github.com/plausible/analytics/blob/b724def948d51a0f...
The erlang docs also mentions this: https://erlang.org/doc/design_principles/gen_server_concepts...