FedecksClient.Websockets.MintWs (fedecks_client v0.1.0)
Holds a MintWs connection and associated websocket and Fedecks inforrmation.
Note the functional approach taken by Mint
- each operation returns a copy of this struct,
updated (probably) by the operation.
Connections are active
, ie downstream messsages and responses from the server will
be received as messages to the connecting process. Use handle_in/2
for processing
those messages, which are of the form {:tcp, socket :: port(), data :: String.t()}
.
Link to this section Summary
Functions
Just creates the struct ready for connection, but not connected. URL validation takes place and requires the scheme to be "ws" or "wss"
Link to this section Types
@type t() :: %FedecksClient.Websockets.MintWs{ conn: nil | Mint.HTTP.t(), device_id: String.t(), ref: nil | reference(), websocket: nil | Mint.WebSocket.t(), ws_url: FedecksClient.Websockets.WebsocketUrl.t() }
Link to this section Functions
Link to this function
new(url, device_id)
Just creates the struct ready for connection, but not connected. URL validation takes place and requires the scheme to be "ws" or "wss"