We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11601a6 commit b598df4Copy full SHA for b598df4
lib/koans/18_genservers.ex
@@ -12,9 +12,13 @@ defmodule GenServers do
12
{:ok, args}
13
end
14
15
- def start_link(init_password) do
+ def start(init_password) do
16
# The __MODULE__ macro returns the current module name as an atom
17
- GenServer.start_link(__MODULE__, init_password, name: __MODULE__)
+ GenServer.start(__MODULE__, init_password, name: __MODULE__)
18
+ end
19
+
20
+ def stop do
21
+ GenServer.stop(__MODULE__)
22
23
24
def unlock(password) do
@@ -151,5 +155,7 @@ defmodule GenServers do
151
155
152
156
{_, response} = Laptop.owner_name()
153
157
assert response == ___
158
159
+ :ok = Laptop.stop()
154
160
161
0 commit comments