Skip to content

Commit

Permalink
Improve docs for 'When Handler Isn't Enough'
Browse files Browse the repository at this point in the history
Fixes #118
  • Loading branch information
mtrudel committed Apr 10, 2024
1 parent 38ec768 commit c1b5246
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/thousand_island/handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,14 @@ defmodule ThousandIsland.Handler do
consisting of the configured handler and genserver opts. This function is expected to return a
conventional `GenServer.on_start()` style tuple. Note that this newly created process is not
passed the connection socket immediately.
2. The socket will be passed to the new process via a message of the form
`{:thousand_island_ready, socket, server_config, acceptor_span, start_time}`.
3. Once the process receives the socket, it must call `ThousandIsland.Socket.handshake/1` with the socket as the sole
argument in order to finalize the setup of the socket.
4. The socket is now ready to use.
2. The raw `t:ThousandIsland.Transport.socket()` socket will be passed to the new process via a
message of the form `{:thousand_island_ready, raw_socket, server_config, acceptor_span,
start_time}`.
3. Your implenentation must turn this into a `to:ThousandIsland.Socket.t()` socket by using the
`ThousandIsland.Socket.new/3` call.
4. Your implementation must then call `ThousandIsland.Socket.handshake/1` with the socket as the
sole argument in order to finalize the setup of the socket.
5. The socket is now ready to use.
In addition to this process, there are several other considerations to be aware of:
Expand Down

0 comments on commit c1b5246

Please sign in to comment.