ack v0.3.1 Ack.Horn View Source

The publisher, sending broadcasts when ACK is received. It serves three different channels:

  • {Ack.Horn, :ack} to send broadcast when the ACK comes
  • {Ack.Horn, :nack} to send broadcast when the NACK comes
  • {Ack.Horn, :error} to send broadcast when the client:

    • called back with the wrong key (status: :invalid)
    • called back with the unknown ACK value (status: :unknown)
    • did not called back and the timeout has expired.

Host and client might agree on using more verbs besides ACK and NACK. To handle this the host should implement somewhat like the following clause:

def handle_envio(%{status: :unknown, key: key, value: verb} = message, state) do
  state = BusinessLogic.on_other_verb(key)
  {:noreply, state}
end

Link to this section Summary

Link to this section Functions

Link to this function

broadcast(message)

View Source
broadcast(message :: map()) :: :ok