Aino.WebSocket.Handler behaviour (aino v0.2.0)
Process an incoming websocket from Aino
Link to this section Summary
Callbacks
Handle incoming text data
Handle internal Erlang messages
Called during websocket initialization
Link to this section Callbacks
Link to this callback
handle(token, data)
Specs
Handle incoming text data
Token is a map with the state's session data, any updates in this map
will be preserved. If the response
key is present, it will be sent
to the browser.
Link to this callback
info(token, message)
Specs
Handle internal Erlang messages
Token is a map with the state's session data, any updates in this map
will be preserved. If the response
key is present, it will be sent
to the browser.
Link to this callback
init(state)
Specs
Called during websocket initialization
Chance to hook into initialization and modify the state based on data in the request. For instance, load the current user based on session data.