Virviil
Registry: Supervising and Dispatching at the same time?
It’s very easy to supervise :simple_one_for_one children with Registry. The Registry is unique, and via tuple works very good.
But the question is: How to dispatch to all these children?
It seems to me, that is possible to dispatch only to duplicate registry!
Why it’s not possible to list all registered in Registry pid’s?
The workaround is - using Supervisor.which_children get all pids and dispatch messages to them. But it looks a bit rusty.
Most Liked
sasajuric
It’s going to work fine for both registries. If the process terminates, it’s deregistered from all the registries. When the new process is started, it will be properly registered with both registries. You don’t need to check whether the process is already registered, nor remove it from the registry manually.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








