@@ -78,14 +78,14 @@ defmodule Registry do
78
78
Now, an entity interested in dispatching events for a given key may call
79
79
`dispatch/3` passing in the key and a callback. This callback will be invoked
80
80
with a list of all the values registered under the requested key, alongside
81
- the pid of the process that registered each value, in the form of `{pid,
81
+ the PID of the process that registered each value, in the form of `{pid,
82
82
value}` tuples. In our example, `value` will be the `{module, function}` tuple
83
83
in the code above:
84
84
85
85
Registry.dispatch(Registry.DispatcherTest, "hello", fn entries ->
86
86
for {pid, {module, function}} <- entries, do: apply(module, function, [pid])
87
87
end)
88
- # Prints #PID<...> where the pid is for the process that called register/3 above
88
+ # Prints #PID<...> where the PID is for the process that called register/3 above
89
89
#=> :ok
90
90
91
91
Dispatching happens in the process that calls `dispatch/3` either serially or
@@ -161,7 +161,7 @@ defmodule Registry do
161
161
in the function documentation.
162
162
163
163
However, keep in mind those cases are typically not an issue. After all, a
164
- process referenced by a pid may crash at any time, including between getting
164
+ process referenced by a PID may crash at any time, including between getting
165
165
the value from the registry and sending it a message. Many parts of the standard
166
166
library are designed to cope with that, such as `Process.monitor/1` which will
167
167
deliver the `:DOWN` message immediately if the monitored process is already dead
@@ -423,8 +423,8 @@ defmodule Registry do
423
423
for the given `registry`.
424
424
425
425
The list of `entries` is a non-empty list of two-element tuples where
426
- the first element is the pid and the second element is the value
427
- associated to the pid . If there are no entries for the given key,
426
+ the first element is the PID and the second element is the value
427
+ associated to the PID . If there are no entries for the given key,
428
428
the callback is never invoked.
429
429
430
430
If the registry is partitioned, the callback is invoked multiple times
@@ -868,11 +868,11 @@ defmodule Registry do
868
868
lookup.
869
869
870
870
This function returns `{:ok, owner}` or `{:error, reason}`.
871
- The `owner` is the pid in the registry partition responsible for
872
- the pid . The owner is automatically linked to the caller.
871
+ The `owner` is the PID in the registry partition responsible for
872
+ the PID . The owner is automatically linked to the caller.
873
873
874
874
If the registry has unique keys, it will return `{:ok, owner}` unless
875
- the key is already associated to a pid , in which case it returns
875
+ the key is already associated to a PID , in which case it returns
876
876
`{:error, {:already_registered, pid}}`.
877
877
878
878
If the registry has duplicate keys, multiple registrations from the
@@ -1220,12 +1220,12 @@ defmodule Registry.Supervisor do
1220
1220
end
1221
1221
1222
1222
# Unique registries have their key partition hashed by key.
1223
- # This means that, if a pid partition crashes, it may have
1223
+ # This means that, if a PID partition crashes, it may have
1224
1224
# entries from all key partitions, so we need to crash all.
1225
1225
defp strategy_for_kind ( :unique ) , do: :one_for_all
1226
1226
1227
1227
# Duplicate registries have both key and pid partitions hashed
1228
- # by pid. This means that, if a pid partition crashes, all of
1228
+ # by pid. This means that, if a PID partition crashes, all of
1229
1229
# its associated entries are in its sibling table, so we crash one.
1230
1230
defp strategy_for_kind ( :duplicate ) , do: :one_for_one
1231
1231
end
0 commit comments