Pushest v0.2.2 Pushest.Socket.Data.SocketInfo View Source

Structure representing a basic socket informations which are being sent when connection with Pusher server is estabilished. This module handles decode action for a SocketInfo.

Link to this section Summary

Functions

Decodes frame from stringified JSON to SocketInfo struct

Link to this section Functions

Link to this function decode(socket_info) View Source
decode(map()) :: %Pushest.Socket.Data.SocketInfo{
  activity_timeout: term(),
  socket_id: term()
}

Decodes frame from stringified JSON to SocketInfo struct.

Examples

iex> Pushest.Socket.Data.SocketInfo.decode(%{"socket_id" => "123.456", "activity_timeout" => 120})
%Pushest.Socket.Data.SocketInfo{socket_id: "123.456", activity_timeout: 120}