Skip to content

Commit ad1ac3b

Browse files
committed
Use a different name for the registry
1 parent 844c4c3 commit ad1ac3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/elixir/lib/registry.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,12 +1304,12 @@ defmodule Registry do
13041304
iex> Registry.select(Registry.SelectAllTest, [{{:"$1", :"$2", :"$3"}, [], [{{:"$1", :"$2", :"$3"}}]}]) |> Enum.sort()
13051305
[{"hello", self(), :value}, {"world", self(), :value}]
13061306
1307-
Get all keys in the registry:
1307+
If you want to get keys, you can pass a separate selector:
13081308
1309-
iex> Registry.start_link(keys: :unique, name: Registry.SelectAllTest)
1310-
iex> {:ok, _} = Registry.register(Registry.SelectAllTest, "hello", :value)
1311-
iex> {:ok, _} = Registry.register(Registry.SelectAllTest, "world", :value)
1312-
iex> Registry.select(Registry.SelectAllTest, [{{:"$1", :_, :_}, [], [:"$1"]}]) |> Enum.sort()
1309+
iex> Registry.start_link(keys: :unique, name: Registry.SelectKeysTest)
1310+
iex> {:ok, _} = Registry.register(Registry.SelectKeysTest, "hello", :value)
1311+
iex> {:ok, _} = Registry.register(Registry.SelectKeysTest, "world", :value)
1312+
iex> Registry.select(Registry.SelectKeysTest, [{{:"$1", :_, :_}, [], [:"$1"]}]) |> Enum.sort()
13131313
["hello", "world"]
13141314
13151315
"""

0 commit comments

Comments
 (0)