Skip to content

Commit 789cce6

Browse files
committed
Fix a couple typos in 'Task and gen_tcp'
1 parent 31b1717 commit 789cce6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

getting-started/mix-otp/task-and-gen-tcp.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ This is pretty much all we need to implement our echo server. Let's give it a tr
9494

9595
Start an iex session inside the `kv_server` application with `iex -S mix`. Inside IEx, run:
9696

97-
```elixir
97+
```iex
9898
iex> KVServer.accept(4040)
9999
```
100100

@@ -208,7 +208,7 @@ This is similar to the mistake we made when we called `KV.Bucket.start_link/0` f
208208

209209
The code above would have the same flaw: if we link the `serve(client)` task to the acceptor, a crash when serving a request would bring the acceptor, and consequently all other connections, down.
210210

211-
We fixed the issue for the registry by using a simple one for one supervisor. We are going to use the same tactic here, except that this pattern is so common with tasks that tasks already come with a solution: a simple one for one supervisor with temporary workers that we can just use in our supervision tree!
211+
We fixed the issue for the registry by using a simple one for one supervisor. We are going to use the same tactic here, except that this pattern is so common with tasks that `Task` already come with a solution: a simple one for one supervisor with temporary workers that we can just use in our supervision tree!
212212

213213
Let's change `start/2` once again, to add a supervisor to our tree:
214214

@@ -228,7 +228,7 @@ end
228228

229229
We simply start a [`Task.Supervisor`](/docs/stable/elixir/#!Task.Supervisor.html) process with name `KVServer.TaskSupervisor`. Remember, since the acceptor task depends on this supervisor, the supervisor must be started first.
230230

231-
Now we just need to change `loop_acceptor/2` to use `Task.Supervisor` to serve each request:
231+
Now we just need to change `loop_acceptor/1` to use `Task.Supervisor` to serve each request:
232232

233233
```elixir
234234
defp loop_acceptor(socket) do

0 commit comments

Comments
 (0)