Kitto v0.9.1 Kitto.Notifier View Source

Module responsible for broadcasting events across connections.

Link to this section Summary

Functions

Emits a server-sent event to each of the active connections with the given topic and payload

Emits a server-sent event to each of the active connections with the given topic and payload to a specific process

Returns cached broadcasts

Caches the given payload with the key provided as the first argument

Returns a specification to start this module under a supervisor

Resets the broadcast cache

Returns the registered connections

Removes a connection from the connections list

Every new SSE connection gets all the cached payloads for each job. The last broadcasted payload of each job is cached

Updates the list of connections to use for broadcasting

Starts the connections cache agent

Starts the notifier supervision tree

Starts the notifier cache agent

Link to this section Functions

Link to this function broadcast!(data, topic) View Source
broadcast!(atom | String.t, atom | map | list) :: list

Emits a server-sent event to each of the active connections with the given topic and payload

Link to this function broadcast!(pid, topic, data) View Source
broadcast!(pid, atom | String.t, map | list) :: list

Emits a server-sent event to each of the active connections with the given topic and payload to a specific process

Returns cached broadcasts

Caches the given payload with the key provided as the first argument

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function clear_cache() View Source
clear_cache() :: :ok

Resets the broadcast cache

Link to this function connections() View Source
connections() :: [Conn.t]

Returns the registered connections

Link to this function delete(conn) View Source
delete(Conn.t) :: :ok

Removes a connection from the connections list

Link to this function initial_broadcast!(pid) View Source
initial_broadcast!(pid) :: list

Every new SSE connection gets all the cached payloads for each job. The last broadcasted payload of each job is cached

Link to this function register(conn) View Source
register(Conn.t) :: Conn.t

Updates the list of connections to use for broadcasting

Link to this function start_connections_cache() View Source

Starts the connections cache agent

Starts the notifier supervision tree

Starts the notifier cache agent