glock v0.1.0 Glock.Stream View Source

Implements a Glock websocket connection as an Elixir Stream resource, returning messages as they are received until the connection is terminated, either by the remote websocket server or by exiting the Glock process.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Synchronously send a message to the remote server via the glock process.

Asynchronously send a message to the remote server via the glock process.

Start a named glock process outside of a supervision tree, passing all http and websocket configuration options for initialization.

Start a named glock process and link it to the calling process, passing all http and websocket configuration options for initialization.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

push(conn, message)

View Source
push(GenServer.server(), term()) :: :ok | :close

Synchronously send a message to the remote server via the glock process.

Link to this function

push_async(conn, message)

View Source
push_async(GenServer.server(), term()) :: :ok

Asynchronously send a message to the remote server via the glock process.

Start a named glock process outside of a supervision tree, passing all http and websocket configuration options for initialization.

Start a named glock process and link it to the calling process, passing all http and websocket configuration options for initialization.