{"id":17964793,"url":"https://github.com/kopera/erlang-reg","last_synced_at":"2025-10-08T14:10:47.803Z","repository":{"id":57542744,"uuid":"224695674","full_name":"kopera/erlang-reg","owner":"kopera","description":"Alternative Erlang registry","archived":false,"fork":false,"pushed_at":"2019-11-28T17:11:49.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-23T03:32:33.371Z","etag":null,"topics":["erlang","pubsub","registry"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kopera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-28T16:51:19.000Z","updated_at":"2019-11-28T17:12:50.000Z","dependencies_parsed_at":"2022-09-26T18:31:21.769Z","dependency_job_id":null,"html_url":"https://github.com/kopera/erlang-reg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kopera/erlang-reg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-reg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-reg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-reg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-reg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopera","download_url":"https://codeload.github.com/kopera/erlang-reg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-reg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278956334,"owners_count":26075221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erlang","pubsub","registry"],"created_at":"2024-10-29T12:08:42.751Z","updated_at":"2025-10-08T14:10:47.769Z","avatar_url":"https://github.com/kopera.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reg\n\nAn Erlang process registry based on/inspired by the Elixir process registry.\n\nThis registry allows for the lookup of processes based on a given key. The\nregistry comes in two flavors/kinds: `unique` and `duplicate`. When a registry\nis started as `unique` registry, only one process is allowed to register using\nthe given key, that is a given key will point to 0 or 1 processes.\n\n# Setup\n\nYou need to add `reg` as a dependency to your project. If you are using `rebar3`,\nyou can add the following to your `rebar.config`:\n\n```erlang\n{deps, [\n    {reg, \"0.1.0\"}\n]}.\n```\n\nAlso ensure that `reg` is added as a dependency to your application, by updating\nyour `.app.src` file:\n\n```erlang\n{application, my_app, [\n\n    {applications, [\n        kernel,\n        stdlib,\n\n        reg  % \u003c- You need this in your applications list\n    ]}\n]}.\n```\n\n# Usage\n\n## Starting a registry\n\nYou can start one or more registries in your application, it is recommended to start\n`reg` under your supervision tree:\n\n```erlang\ninit([]) -\u003e\n    Flags = #{strategy =\u003e rest_for_one},\n    Children = [\n        reg:child_spec(my_registry, #{\n            kind =\u003e duplicate % \u003c- This should be set to `unique` for unique registries\n        }),\n        % ...\n    ],\n    {ok, {Flags, Children}}.\n```\n\n## Registering a process\nTo register a process with the key `key1` and the value `value`, you just need to\ncall `register/3` from the registering process\n\n```erlang\n\u003e reg:register(my_registry, key1, value).\nok\n```\n\n## Looking up processes\n\nTo find all processes registered under the key `key1`:\n\n```erlang\n\u003e reg:lookup(my_registry, key1).\n[{\u003c0.145.0\u003e, value}]\n```\n\n## Unregistering\nA process can unregister by calling the `reg:unregister/2` function. A process is\nalso automatically unregistered when it terminates.\n\n```erlang\n\u003e reg:unregister(my_registry, key1).\nok\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopera%2Ferlang-reg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopera%2Ferlang-reg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopera%2Ferlang-reg/lists"}