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
socket() :: :gen_udp.socket() | :gen_tcp.socket() | :ssl.sslsocket()
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
get_worker(encoded_event(), atom()) :: pid() | error()
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.
release(pid(), encoded_event(), atom()) :: :ok
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 Callbacks
get_worker(e :: encoded_event(), p :: atom()) :: pid() | error()
release(w :: pid(), e :: encoded_event(), p :: atom()) :: :ok
send(w :: pid(), e :: encoded_event()) :: :ok | error()
send_async(w :: pid(), e :: encoded_event()) :: :ok