I made a PR that implements 
this: https://github.com/elixir-lang/elixir/pull/12609

On Friday, May 26, 2023 at 10:39:28 AM UTC-7 Noah Betzen wrote:

> Erlang's process group module allows adding arbitrary PIDs to a group, 
> which can be used for things like PubSub: 
> https://www.erlang.org/doc/man/pg.html
>
> Registry's register function currently always registers the current 
> process; you cannot register an arbitrary process: 
> https://hexdocs.pm/elixir/1.14.5/Registry.html#register/3
>
> However, there are ways to work around this with Registry; see attached 
> Livebook markdown for an example.
>
> I propose new functions:
>
>    - Registry.register/4
>       - register(pid, registry, key, value)
>       - Registry.unregister/3
>       - unregister(pid, registry, key)
>       - Registry.unregister_match/5
>       - unregister_match(pid, registry, key, pattern, guards \\ [])
>       - Registry.update_value/4
>       - update_value(pid, registry, key, callback)
>       
> Another (potentially simpler) option might be to have the pid argument be 
> at the end and make it default to self().
>
> Thoughts? 😄 
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/7245ecb4-260d-472a-a887-46f87d362019n%40googlegroups.com.

Reply via email to