Comments (3)
Noted and agreed! I'll get this updated just as soon as I can!
from thousand_island.
This is describing the fact that, if your Handler implementation happens to implement any other handle_*
calls other than those that are part of the ThousandIsland.Handler behaviour, any read timeout is cancelled. For example, if you have a handler like this:
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 handle_info/2
calls will see state as {socket, state}
). If you do implement callbacks as above, you can always pass any GenServer compliant result tuple back, including those that seem timeouts.
from thousand_island.
@mtrudel for my own understanding, any anyone who searches this in the future, and before official docs explain more clearly-- what is this about? :)
from thousand_island.
Related Issues (20)
- Open telemetry? HOT 1
- Support for UDP transport HOT 12
- Question: would `controlling_process/2` be a potential bottleneck? HOT 12
- Process isolation between requests HOT 6
- Acceptor pool race condition HOT 6
- Cannot start multiple ThousandIsland children under a Supervisor HOT 5
- GenServer `:tls_alert` error on handshake failure HOT 6
- Unexpected error in accept: :emfile HOT 26
- Thoughts on adopting PartitionSupervisor HOT 4
- problems with tcpkali HOT 4
- configurable acceptor pools HOT 2
- FunctionClauseError randomly happens HOT 2
- Upgrading the transport mid-connection HOT 6
- Inconsistent callback invoked when data received HOT 6
- A way to align custom and library `GenServer` responses HOT 7
- Slow accepting HOT 2
- handling non-TI messages within same GenServer fails after PR#96 HOT 1
- Feature request: Let the process outlive beyond the connection HOT 9
- Using the ThousandIsland.Handler "escape hatch" HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thousand_island.