Skip to main content

foreign_loop

Function foreign_loop 

Source
pub fn foreign_loop(
    reading: Option<&Reading>,
    now: Timestamp,
    own_pid: u32,
) -> Option<Option<u32>>
Expand description

A loop in another process that is alive right now: a fresh heartbeat in <home>/daemon.json published by a pid that is not own_pid. Some(pid) carries the pid it published (None inside when it published none - a fresh heartbeat is still evidence of a live loop).

The one judgement of “is somebody else serving this queue”, shared by the web UI’s refusal to start a second loop and by magi run / magi review deciding whether to hand a task to the loop. A claim file proves nothing here: whether a claim succeeds says nothing about whether its owner lives.