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 theACK
comes{Ack.Horn, :nack}
to send broadcast when theNACK
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.
- called back with the wrong key (
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