RESTful to websocket API question: I want to enable a RESTful api that interfaces with websockets.
I have some hardware that maintains a WS connection to my Phx.server, and I would like to allow other clients to hit the phx.server via a RESTful api and interact with WS connected hardware.
The part I have not figured out is the response for RESTful call, i.e. the http response. Suppose I want a client to be able to request the current temperature from a sensor on the hardware connected via WS.
I can broadcast to the WS via the controller using Phoenix.Endpoint.broadcast(topic, event, msg), but I want to “wait” for a response so that I can send the temp back in the HTTP response from the client. Any suggestions appreciated.