websocketelixir

Sending a non-client message to a WebSock process


The WebSock documentation states that the handle_info/2 callback is

Called by WebSock when the socket process receives a GenServer.handle_info/2 call which was not otherwise processed by the server implementation.

is there another, idiomatic way to send a message to a WebSock process from another process, that is not a websocket client?


Solution

  • Just as with any other GenServer, you can Kernel.send/2 a message to the WebSock process.