View Source Tulle.Websocket behaviour (tulle v0.7.3)
Websocket client, implemented as a Genserver.
use
'ing this module defines a child_spec
functions,
and defines @behaviour Tulle.Websocket
.
Summary
Types
Must have :url
, optionally can have :headers
and :extensions
.
(defaults to PerMessageDeflate
).
Functions
Returns a specification to start this module under a supervisor.
Types
Callbacks
@callback handle_connect(state :: any()) :: handle_result()
@callback handle_in(message(), state :: any()) :: handle_result()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec close(GenServer.server(), 1000..4999) :: :ok | {:unclean, term()} | {:error, term()}
@spec send(GenServer.server(), :binary | :text, binary() | String.t()) :: :ok | {:error, term()}
@spec start_link(WebSock.impl(), any(), conn_opts(), GenServer.options()) :: GenServer.on_start()