Skip to content

Elixir distributed process registry system built on top of Ra

Notifications You must be signed in to change notification settings

hkrutzer/ragistry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ragistry

Documentation badge Hex.pm badge

A work-in-progress distributed process registry system built on top of the Ra implementation of Raft.

Usage

# Start the registry
{:ok, _pid} = Ragistry.start_link(name: :my_registry)

# Register a key-value pair
:ok = Ragistry.register(:my_registry, "key1", "value1")

# Look up a registration
[{pid, "value1"}] = Ragistry.lookup(:my_registry, "key1")

# Unregister a key
:ok = Ragistry.unregister(:my_registry, "key1")

Ragistry works across a cluster of nodes:

# Start registry on each node in the cluster
Node1> Ragistry.start_link(name: :distributed_registry)
Node2> Ragistry.start_link(name: :distributed_registry)

# Registration on one node is visible to all nodes
Node1> {:ok, pid} = Agent.start_link(
  fn -> "state" end,
  name: {:via, Ragistry, {:distributed_registry, "shared_key", "value"}}
)

# Look up from any node
Node2> [{pid, "value"}] = Ragistry.lookup(:distributed_registry, "shared_key")

About

Elixir distributed process registry system built on top of Ra

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages