arjan
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
Trending in Announcing
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Hello,
I’m sharing my plugin here in forum after some time so it has time to mature and proof yourself.
I use Claude Code daily on a pr...
New
Aloha gang,
There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here:
...
New
I’ve recently created a small library phoenix_vite integrating the vite build tooling with phoenix.
It
provides an igniter.installer t...
New
I needed something like premailer for rails, and after searching, I decided to make an easy-to-use library to handle inline styles and co...
New
If you’ve ever had to debug a BEAM node you know it can be a painful process. Parsing raw data, or dealing with clutter often gets in the...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Code BEAM Europe 2026 – Call for Talks is Open!
We’re excited to announce that Code BEAM Europe 2026 is now open for talk submissions :t...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #elixirconf-us
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance











Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Tuxified
Sounds useful, thanks. Might be something for a lighting talk? Judging by the amount of hex packages, perhaps even a
Arjans toolbox-talkbodgix
Hi.
Thanks for putting the library together.
Before I found it, I’ve been trying to hack my own implementation and I ended up with a very similar code as yours.
However, both your code and mine suffers from an unexpected behavior.
When a 2nd node joins the cluster, I do see:
But what is unexpected is that not only the singleton process is terminated, but the whole application on one of the nodes:
And one of the nodes basically is left in a state where my own application is not running, only the “libraries” continue running.
I’ve been struggling with the same issue in my own implementation.
I created a DynamicSupervisor for the singleton process, similarly to you and I was hoping that it will “shield” the main Application supervisor from crashing when the :global registry kills one of the singleton processes.
However, that doesn’t seem to be the case and the whole application dies regardless of multiple layers of supervisors
Using Elixir version 1.12.3
Abdallah94
@bodgix have you managed to solve this issue? we’re facing the same problem
al2o3cr
What is
restartset to in the “singleton” GenServer? If it’s set to the default:permanent, then the supervisor on the joined node will keep restarting the process over and over again until it also gives up, cascading down the chain of supervisors until the whole application stops.Does the behavior change if you specify
use GenServer, restart: :temporary?