fireproofsocks
I find it surprising that :via is not supported for duplicate registries. If you can’t register a pool of processes under the same name what exactly is the use-case for having duplicate-key registries? The docs include an example of dispatching (Registry — Elixir v1.21.0-dev), but I’m not clear how you would even put a process into a custom Registry if :via is not allowed. What am I missing? How do you actually use a custom Registry with duplicate keys?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
How Can I Optimise Compile Time Dependencies
I have been building an elixir application for about 2 years now. Many modules and files ha...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
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 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
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
Registry.registerexists. You can manually (and explicitly) call it.:viais just a way to let OTP take over the process registration. But that comes with the downside that via expects a given via tuple to map to a single process, not multiple ones.derek-zhou
Process pooling is not included in the standard library of Elixir. There a few excellent libraries on hex.pm:
Some use-cases for having duplicate-key registries are explained in your linked documentation, if only you read a few more paragraphs from that point, you will find them.
al2o3cr
:viaisn’t specifically related toRegistry, it’s just a fancy way to tell:gen’s name handling to callregister_nameandwhereis_nameon a specified module:https://github.com/erlang/otp/blob/9ff030be08a162c12a13d5dfdf24f90048a24233/lib/stdlib/src/gen.erl#L622-L640
(related: Elixir’s wrappers transform a bare atom name into
{:local, name})Conversely,
Registryisn’t otherwise related to process naming - it’s just a key-value store that automatically cleans up keys when the registering process exits.The simplest thing to build with a
:duplicateregistry is a local publish-subscribe bus:{:foo, 123}useRegistry.registerto “subscribe” to that key{:foo, 123}, the sender usesRegistry.dispatchto send it to each PIDYou might even use both a
:uniqueand a:duplicateregistry with the same keys, for instance in the classic “multiplayer game” architecture::uniqueregistry tracks a GenServer per “game”. A:viatuple pointing to this registry is used when sending moves, joins, etc to the game:duplicateregistry tracks the Liveview processes of players per “game”, and is used to distribute updates to all playersfireproofsocks
Thank you for the informative responses! This is stuff that I’m going to have to ponder about for a while, but I see the set/get is pretty straightforward using
Registry.register/3andRegistry.lookup/2:What is interesting to me is that
Registry.register/3really is all about storing the current process – the value seems almost secondary. The other thing that is interesting is that when a process terminates, anything that it registered gets removed (as. you pointed out Matt):I feel like I’m only becoming dimly aware of the things that you can do with these tools…
LostKobrakai
That’s true indeed. In the end it’s a registry, so exists to hold registrations of processes. But the value can be very useful for certain usecases within the space of process registration.