Registry
Registry.start_link(keys: :unique, name: Registry.SelectAllTest)
iex> {:ok, _} = Registry.register(Registry.SelectAllTest, "hello", :value)
iex> {:ok, _} = Registry.register(Registry.SelectAllTest, "world", :value)
iex> Registry.select(Registry.SelectAllTest, [{{:"$1", :_, :_}, [], [:"$1"]}])
["world", "hello"]
Event Store
https://github.com/commanded/eventstore/blob/master/guides/Subscriptions.md#subscribe-to-all-events
alias MyApp.EventStore
{:ok, subscription} = EventStore.subscribe_to_all_streams("example_all_subscription", self())
# Wait for the subscription confirmation
receive do
{:subscribed, ^subscription} ->
IO.puts("Successfully subscribed to all streams")
end
receive do
{:events, events} ->
IO.puts "Received events: #{inspect events}"
# Acknowledge receipt
:ok = EventStore.ack(subscription, events)
end