FedecksClient.Connector (fedecks_client v0.1.0)

Manages connecting, and reconnecting, to a server over websockets

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

The current connection status

Attempt to login with the credentials

Send a message as any Erlang term to the server

Send an unencoded binary messagaas any to the server

Link to this section Types

Link to this type

connection_status()

@type connection_status() ::
  :unregistered
  | :connecting
  | :connection_scheduled
  | :failed_registration
  | :connected
@type t() :: %FedecksClient.Connector{
  broadcast_topic: atom(),
  connect_delay: pos_integer(),
  connection_schedule_ref: reference(),
  connection_status: connection_status(),
  mint_ws: FedecksClient.Websockets.MintWs.t(),
  ping_frequency: pos_integer(),
  token_store: atom()
}

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

connection_status(server)

@spec connection_status(GenServer.server()) :: connection_status()

The current connection status

Link to this function

login(server, credentials)

@spec login(GenServer.server(), credentials :: term()) :: :ok

Attempt to login with the credentials

Link to this function

send_message(server, message)

@spec send_message(GenServer.server(), term()) :: :ok

Send a message as any Erlang term to the server

Link to this function

send_raw_message(server, message)

@spec send_raw_message(GenServer.server(), binary()) :: :ok

Send an unencoded binary messagaas any to the server

Link to this function

server_name(base_name)

Link to this function

start_link(args)

@spec start_link(keyword()) :: :ignore | {:error, any()} | {:ok, pid()}