Bellwether.AgentSocket (bellwether v0.1.0)

Copy Markdown

The Adapter's end of the socket to the Agent.

Fire and forget, deliberately. If the Agent is not listening the Event is dropped rather than queued or retried. Two reasons: this often runs inside a process that is already dying, and the Agent being down is itself something the next boot reports — a queue here would trade a known gap for an unknown one, in the process least able to afford the memory.

Reconnection is lazy. A send on a dead socket tries once to reconnect and then gives up until the next send, so a missing Agent costs one failed connect per Event rather than a busy loop.

Summary

Functions

Returns a specification to start this module under a supervisor.

Hand an Event to the Agent. Always returns :ok; delivery is not promised.

Counts of what happened, for the Agent's own selftest.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

send_event(event, server \\ __MODULE__)

Hand an Event to the Agent. Always returns :ok; delivery is not promised.

sink(server \\ __MODULE__)

For Bellwether.Reporter's :sink option.

start_link(opts \\ [])

stats(server \\ __MODULE__)

Counts of what happened, for the Agent's own selftest.