Skip to content

Commit b0dae83

Browse files
committed
Clarify the need for better tools in the TCP guide
1 parent 40da7e8 commit b0dae83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/elixir/pages/mix-and-otp/task-and-gen-tcp.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ say me
157157
say me
158158
```
159159

160-
Yes, it works! However, does it *scale*?
160+
Yes, it works! However, can it handle more than one client?
161161

162162
Try to connect two telnet clients at the same time. When you do so, you will notice that the second client doesn't echo:
163163

@@ -303,4 +303,8 @@ Luckily, this can be done by using `Supervisor.child_spec/2`, which allows us to
303303

304304
Now we have an always running acceptor that starts temporary task processes under an always running task supervisor.
305305

306+
## Wrapping up
307+
308+
In this chapter we have implemented a straigh-forward TCP acceptor, which allowed is to explore tools for concurrency and fault-tolerance. While our acceptor can manage concurrent connections, it is still not ready for production. In practice, TCP servers run a pool of acceptors, instead of a single one, each of them with their own supervisor. While Elixir has tools to make it easier to partition and scale the accept, such as the `PartitionSupervisor`, they are out of scope for this guide. In any case, a better path forward may be to use existing packages tailored for this use case, such as [Ranch](https://github.com/ninenines/ranch) (in Erlang) or [Thousand Island](https://github.com/mtrudel/thousand_island) (in Elixir).
309+
306310
In the next chapter, we will start parsing the client requests and sending responses, finishing our server.

0 commit comments

Comments
 (0)