-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs are unclear about GenServer handle_* calls cancelling read timeouts #58
Comments
Noted and agreed! I'll get this updated just as soon as I can! |
@mtrudel for my own understanding, any anyone who searches this in the future, and before official docs explain more clearly-- what is this about? :) |
This is describing the fact that, if your Handler implementation happens to implement any other defmodule Echo do
@moduledoc """
A sample Handler implementation of the Echo protocol
https://en.wikipedia.org/wiki/Echo_Protocol
"""
use ThousandIsland.Handler
@impl ThousandIsland.Handler
def handle_data(data, socket, state) do
ThousandIsland.Socket.send(socket, data)
{:continue, state, 60_000}
end
def handle_info(msg, state), do:
# Calling this will cancel the 60s timeout set above
{:noreply, state}
end
end The reason for this is that Thousand Island itself is just a bit of sugar on top of GenServer, and read timeouts are set as part of this sugar. (This is the same reason that any such |
From the Handler documentation, ThousandIsland.Handler behaviour, step 4:
It's hard to understand from the documentation what this is referring to.
The text was updated successfully, but these errors were encountered: