Skip to main content

Module note_queue

Module note_queue 

Source
Expand description

Memory copies the pack did not take because it was down or did not know this seat.

ljos note writes the logbook line first, then a note atom to the pack. When the pack is off, not answering, or answers 401, the fitted copy waits here, one JSON line per copy, and the next note that reaches the pack, ljos finish, or the next session start sends it. ljos doctor only counts it. A refusal is not queued: the pack would refuse it again. A line left from before that rule is cut to what the pack takes, or dropped, on the next send. The queue holds one entry per issue, text, workspace, kind and, for a lesson, the atoms it closes. packsetd answers an identical issue and text with the claim it already holds, so a resend after a lost answer stores nothing new.

Structs§

Drained
What a drain did.
Queued
One memory waiting for the pack.
SetAside
Bytes of the queue a rewrite moved to a file beside it rather than drop: complete lines that did not parse and a last line without its newline.

Enums§

Sent
What one send says about a queued note.

Functions§

busy_in
The queue lock in dir when another ljos holds it now, queueing or sending; tried without waiting for it.
drain_in
Send each waiting note in dir through send, oldest first. A kept or refused note leaves the queue; the first one that has to wait stops the drain, and it and every later note stay, in order.
drained_lines
The lines a drain prints: what went, what the pack refused, and what still waits. Empty when nothing was queued.
pending_in
The notes waiting in dir, oldest first.
push_in
Add note to the queue in dir. false when the same copy already waits there, including the atoms a lesson closes.
replace_in
Replace the waiting memories in dir.
set_aside_at
The damaged files a rewrite left in the state dir open as fd, named below dir, with their sizes, oldest day first. Each name is listed and stated through fd, without following a link and without opening one, so name and size come from the same directory; a link or anything else that is not a regular file is left out, since a send never writes through one.
set_aside_in
set_aside_at for dir, opened the way every state-log open is: a link in place of dir is refused and lists nothing.
state_dir
The state dir that holds the queue: $XDG_STATE_HOME/ljos, else ~/.local/state/ljos.
tidy_in
Fit the waiting memories in dir with fit and set aside the bytes that are not a memory, rewriting the queue only when either changes it. Reading and rewriting under one lock keeps a note queued between them.