You can see an Erlang example in how poolboy process builds its state:
https://github.com/devinus/poolboy/blob/master/src/poolboy.erl#L125-L146
I can’t think of elixir examples right now.
UPDATE: You can see an elixir example in this refactoring of credo (that didn’t actually make it, but shows the idea quite nicely):
https://github.com/rrrene/credo/pull/107/files#diff-6a5ceb395f2a140c73ab593bf06fcb55






















