Skip to main content

send

Function send 

Source
pub fn send(home: &Path, m: Message, now: i64) -> Result<Message, SendError>
Expand description

Sends m from the store home at now: refused when every reader would drop it or its sender’s window to the recipient is full (window_for; a steer is never paced: a pause is answered by a resume). The write keeps the log bounded (bound). A steer from this node is admitted first, as Role::Local (steer.rs), so a reader that sees its line sees it count.

A steer for a session of another node is refused unless this node may steer there (steer_right): that node would drop the line at admission, and the sender would be told it holds. So is a message for a session on a node whose borg reads no line of its format (reads_at): it would never be shown there, and it would hold the window.

§Errors

An empty text, a malformed field, a steer this node may not send, a recipient’s node that cannot read it, a full window (with how many are unread), or a write failure.