Skip to main content

Module relay_watch

Module relay_watch 

Source
Expand description

A message handed to the cloud relay is queued, not delivered: the relay keeps it for a short window and drops it if nobody picks it up, and the sender never heard. This tells the sender, with one AgentMux system note for its next turn, when a message it queued is still unconfirmed after that window, naming the target and the message id, so it can ask again or reach the target another way instead of waiting on a message that went nowhere.

Nothing here learns whether a message was picked up: the one thing srv can see is the target writing to the sender, which shows the target is reachable and so cancels the note. Every other queued message is reported as unconfirmed, in those words, never as lost.

Constants§

RELAY_HOLD_MS
How long the relay keeps a message nobody picked up; what the send answer tells the sender.

Functions§

heard_from
A message from sender to receiver arrived: if receiver had queued one for sender, sender is reachable and that one is no longer watched.
queued_answer
The answer to a send that the relay queued: the usual response, plus what srv knows that the sender can act on at once. target_in_account is the relay’s word on whether the name is one of the sender’s own account’s agents; lan_peers are the LAN peers this machine can see, in words (peer_words::describe_peer), because the message got this far only because the target is not running here or on any of them.
watch
Watch a message just queued at the relay for to by from: once the window has passed with no word from to, from gets the note at its next turn.