talira

Extended process registry and process dictionary for Erlang

open sourceApache-2.0free

gproc is an extended process registry for Erlang (usable from Elixir too). Processes can register under any term as an alias, under several aliases at once, or with non-unique properties shared by many processes; you can query the registry with QLC or match specifications, wait for a process to register, hand names and properties to another process atomically, and keep counters with automatically aggregated totals. An optional global mode applies all of this across a cluster of nodes.

Problems it solves

  • look up an Erlang process by a name that isn't an atom
  • find all processes that have a given property in my Elixir app
  • wait until a worker process has registered before sending it a message

Features

  • register a process under any term, or under several aliases
  • non-unique properties shared by many processes
  • queries with QLC and match specifications
  • await a process's registration
  • atomic hand-over of names and properties
  • counters with automatically aggregated totals
  • optional global registry across nodes

Limitations

  • The global (distributed) mode needs the gen_leader dependency, which isn't fetched by default.1