I created a tiny library which supervises “singleton” processes, using Erlang’s global module.
Processes which are started with Singleton.start_child/3 are guaranteed to run on one single node in your Elixir cluster. The nodes that don’t run the process, monitor it so that when it dies, it gets respawned, possibly on another node. This monitoring part is something that global doesn’t do for you.
It feels a bit “thin” for a hex package but I find it kind of useful (I’m using it as part of a bigger project, obviously). Anyway, check it out: GitHub - arjan/singleton: Global, supervised singleton processes for Elixir · GitHub


















