Skip to content

Commit ac2ee78

Browse files
eksperimentalericmj
authored andcommitted
Use PID instead of pid (#8628)
1 parent 57a15ec commit ac2ee78

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

lib/elixir/lib/dynamic_supervisor.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ defmodule DynamicSupervisor do
405405
406406
* `id` - it is always `:undefined` for dynamic supervisors
407407
408-
* `child` - the pid of the corresponding child process or the
408+
* `child` - the PID of the corresponding child process or the
409409
atom `:restarting` if the process is about to be restarted
410410
411411
* `type` - `:worker` or `:supervisor` as defined in the child

lib/elixir/lib/registry.ex

+10-10
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ defmodule Registry do
7878
Now, an entity interested in dispatching events for a given key may call
7979
`dispatch/3` passing in the key and a callback. This callback will be invoked
8080
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,
8282
value}` tuples. In our example, `value` will be the `{module, function}` tuple
8383
in the code above:
8484
8585
Registry.dispatch(Registry.DispatcherTest, "hello", fn entries ->
8686
for {pid, {module, function}} <- entries, do: apply(module, function, [pid])
8787
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
8989
#=> :ok
9090
9191
Dispatching happens in the process that calls `dispatch/3` either serially or
@@ -161,7 +161,7 @@ defmodule Registry do
161161
in the function documentation.
162162
163163
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
165165
the value from the registry and sending it a message. Many parts of the standard
166166
library are designed to cope with that, such as `Process.monitor/1` which will
167167
deliver the `:DOWN` message immediately if the monitored process is already dead
@@ -423,8 +423,8 @@ defmodule Registry do
423423
for the given `registry`.
424424
425425
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,
428428
the callback is never invoked.
429429
430430
If the registry is partitioned, the callback is invoked multiple times
@@ -868,11 +868,11 @@ defmodule Registry do
868868
lookup.
869869
870870
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.
873873
874874
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
876876
`{:error, {:already_registered, pid}}`.
877877
878878
If the registry has duplicate keys, multiple registrations from the
@@ -1220,12 +1220,12 @@ defmodule Registry.Supervisor do
12201220
end
12211221

12221222
# 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
12241224
# entries from all key partitions, so we need to crash all.
12251225
defp strategy_for_kind(:unique), do: :one_for_all
12261226

12271227
# 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
12291229
# its associated entries are in its sibling table, so we crash one.
12301230
defp strategy_for_kind(:duplicate), do: :one_for_one
12311231
end

lib/iex/test/iex/helpers_test.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1196,8 +1196,8 @@ defmodule IEx.HelpersTest do
11961196
end
11971197
end
11981198

1199-
describe "pid" do
1200-
test "builds a pid from string" do
1199+
describe "pid/1,3" do
1200+
test "builds a PID from string" do
12011201
assert inspect(pid("0.32767.3276")) == "#PID<0.32767.3276>"
12021202
assert inspect(pid("0.5.6")) == "#PID<0.5.6>"
12031203

@@ -1206,7 +1206,7 @@ defmodule IEx.HelpersTest do
12061206
end
12071207
end
12081208

1209-
test "builds a pid from integers" do
1209+
test "builds a PID from integers" do
12101210
assert inspect(pid(0, 32767, 3276)) == "#PID<0.32767.3276>"
12111211
assert inspect(pid(0, 5, 6)) == "#PID<0.5.6>"
12121212

0 commit comments

Comments
 (0)