Stargate.Connection (stargate v0.1.1) View Source

Connection provides the core abstraction for the websocket connection between the client application and the Pulsar cluster shared by all Stargate producer, reader, and consumer processes.

Link to this section Summary

Functions

The Connection using macro provides the common websocket connection and keepalive functionality into a single line for replicating connection and ping/pong handling in a single place.

Parses the keyword list configuration passed to a websocket and constructs the authentication options, either SSL or token-based, to be passed to the websocket process.

Parses the keyword list configuration passed to a websocket and constructs the url needed to establish a connection to the Pulsar cluster. If query params are provided, appends the connection-specific params string to the url and returns the full result as a map to pass to the connection start_link/1 function.

Link to this section Types

Specs

connection_settings() :: %{
  url: String.t(),
  host: String.t(),
  protocol: String.t(),
  persistence: String.t(),
  tenant: String.t(),
  namespace: String.t(),
  topic: String.t()
}

Link to this section Functions

Link to this macro

__using__(opts)

View Source (macro)

The Connection using macro provides the common websocket connection and keepalive functionality into a single line for replicating connection and ping/pong handling in a single place.

Specs

auth_settings(keyword()) :: keyword()

Parses the keyword list configuration passed to a websocket and constructs the authentication options, either SSL or token-based, to be passed to the websocket process.

Link to this function

connection_settings(opts, type, params)

View Source

Specs

connection_settings(keyword(), atom(), String.t()) :: connection_settings()

Parses the keyword list configuration passed to a websocket and constructs the url needed to establish a connection to the Pulsar cluster. If query params are provided, appends the connection-specific params string to the url and returns the full result as a map to pass to the connection start_link/1 function.