File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,10 @@ defmodule GenEvent do
227
227
returns `{:ok, pid}`, where pid is the pid of the server. If there already
228
228
exists a process with the specified server name, the function returns
229
229
`{:error, {:already_started, pid}}` with the pid of that process.
230
+
231
+ Note that a `GenEvent` started with `start_link/1` is linked to the
232
+ parent process and will exit not only on crashes but also if the parent
233
+ process exits with `:normal` reason.
230
234
"""
231
235
@ spec start_link ( options ) :: on_start
232
236
def start_link ( options \\ [ ] ) when is_list ( options ) do
Original file line number Diff line number Diff line change @@ -269,6 +269,11 @@ defmodule GenServer do
269
269
passing the given `args` to initialize it. To ensure a synchronized start-up
270
270
procedure, this function does not return until `init/1` has returned.
271
271
272
+ Note that a `GenServer` started with `start_link/3` is linked to the
273
+ parent process and will exit in case of crashes. The GenServer will also
274
+ exit due to the `:normal` reasons in case it is configured to trap exits
275
+ in the `init/1` callback.
276
+
272
277
## Options
273
278
274
279
The `:name` option is used for name registration as described in the module
Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ defmodule Supervisor do
195
195
an erroneous value, the supervisor will first terminate all already
196
196
started child processes with reason `:shutdown` and then terminate
197
197
itself and return `{:error, {:shutdown, reason}}`.
198
+
199
+ Note that the `Supervisor` is linked to the parent process
200
+ and will exit not only on crashes but also if the parent process
201
+ exits with `:normal` reason.
198
202
"""
199
203
@ spec start_link ( [ tuple ] , options ) :: on_start
200
204
def start_link ( children , options ) when is_list ( children ) do
You can’t perform that action at this time.
0 commit comments