Skip to content

Commit d2aa632

Browse files
agstijosevalim
authored andcommitted
Update genserver.markdown (elixir-lang#1249)
1 parent 600842f commit d2aa632

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

getting-started/mix-otp/genserver.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ defmodule KV.Registry do
102102
end
103103
```
104104

105-
The first function is `start_link/1`, which starts a new GenServer passing three arguments:
105+
The first function is `start_link/1`, which starts a new GenServer passing a list of options. `start_link/1` calls out to `GenServer.start_link/3`, which takes three arguments:
106106

107-
1. The module where the server callbacks are implemented, in this case `__MODULE__`, meaning the current module
107+
1. The module where the server callbacks are implemented, in this case `__MODULE__` (meaning the current module)
108108

109-
2. The initialization arguments, in this case, the atom `:ok`
109+
2. The initialization arguments, in this case the atom `:ok`
110110

111-
3. A list of options which can be used to specify things like the name of the server. For now, we forward the list of options that we receive on `start_link/1`, which defaults to an empty list. We will customize it later on
111+
3. A list of options which can be used to specify things like the name of the server. For now, we forward the list of options that we receive on `start_link/1` to `GenServer.start_link/3`
112112

113113
There are two types of requests you can send to a GenServer: calls and casts. Calls are synchronous and the server **must** send a response back to such requests. Casts are asynchronous and the server won't send a response back.
114114

0 commit comments

Comments
 (0)