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. The next command that may send it tries under the remember budget, and tries once more if the pack is still busy. ljos search and ljos sitting say when a lesson is still waiting. ljos doctor only counts it. A copy the pack would refuse is kept in the memory slot with its label and leaves the queue. A line left from before that rule is cut to what the pack takes on the next send, and the original stays in the slot. A note that has to wait stays queued. Later notes are still tried. The queue holds one entry per issue, text, workspace, kind and, for a lesson, the atoms it closes. The seat that queued the copy stays on the row, so a later seat does not take it. 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. A note that has to wait stays, and the drain still tries every later note.
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.