riemannx v2.4.1 Riemannx.Connection behaviour View Source

This is the behaviour specification for all connections as well as a generic API for communication with them based on the settings given in your config.

The struct in this module is used across all connection types as much of the data is common to all types.

Link to this section Summary

Functions

Fetches a relevant worker based on your connection type

Query the index of the riemann server, only works with the TLS/TCP/Combined setups. UDP is NOT supported

A failed query

An acceptable query response

Tells the given worker to release itself back into the wild

Tells the given worker to synchronously process an event

Tells the given worker to asynchronously process an event

Link to this section Types

Link to this type encoded_event() View Source
encoded_event() :: binary()
Link to this type error() View Source
error() :: [error: binary(), message: binary()]
Link to this type qr() View Source
qr() :: {:ok, list()}
Link to this type query() View Source
query() :: binary()
Link to this type retry_count() View Source
retry_count() :: non_neg_integer() | :infinity
Link to this type socket() View Source
socket() :: :gen_udp.socket() | :gen_tcp.socket() | :ssl.sslsocket()
Link to this type t() View Source
t() :: %Riemannx.Connection{host: String.t(), max_udp_size: non_neg_integer(), priority: Riemannx.Settings.priority(), socket: socket(), ssl_opts: [:ssl.ssl_option()], tcp_port: :inet.port_number(), to: pid(), udp_port: :inet.port_number()}

Link to this section Functions

Link to this function get_worker(e, p \\ :riemannx_pool) View Source
get_worker(encoded_event(), atom()) :: pid() | error()

Fetches a relevant worker based on your connection type.

Link to this function query(pid, m, to) View Source
query(pid() | nil, query(), pid()) :: :ok | error()

Query the index of the riemann server, only works with the TLS/TCP/Combined setups. UDP is NOT supported.

A failed query.

An acceptable query response.

Link to this function release(pid, e, p \\ :riemannx_pool) View Source
release(pid(), encoded_event(), atom()) :: :ok

Tells the given worker to release itself back into the wild.

Link to this function send(pid, e) View Source
send(pid(), encoded_event()) :: :ok | error()

Tells the given worker to synchronously process an event.

Link to this function send_async(pid, e) View Source
send_async(pid(), encoded_event()) :: :ok

Tells the given worker to asynchronously process an event.

Link to this section Callbacks

Link to this callback get_worker(e, p) View Source
get_worker(e :: encoded_event(), p :: atom()) :: pid() | error()
Link to this callback query(w, m, t) View Source
query(w :: pid() | nil, m :: query(), t :: pid()) :: :ok | error()
Link to this callback release(w, e, p) View Source
release(w :: pid(), e :: encoded_event(), p :: atom()) :: :ok
Link to this callback send(w, e) View Source
send(w :: pid(), e :: encoded_event()) :: :ok | error()
Link to this callback send_async(w, e) View Source
send_async(w :: pid(), e :: encoded_event()) :: :ok