WsListener
io.eezo.http.WsListener
trait WsListener
What an application does with a WebSocket connection.
The runtime calls Jetty's demand(), never user code: a listener that forgets to demand is a socket that silently stops, and that failure should be unrepresentable. The contract that creates is finish the work before you return — a listener that hands the message to another thread and returns at once receives the next message immediately, discarding the read backpressure Jetty was chosen for.
There is no onBinary. Jetty's binary event hands over a pooled ByteBuffer with a Callback that releases it, so exposing it means either copying every payload or documenting a use after free. Text arrives as a String and has no such problem.
Attributes
- Source
- Ws.scala
- Graph
-
- Supertypes
Members list
In this article