Skip to main content

Module watch

Module watch 

Source
Expand description

What a long computation has done, for whoever waits for it, and whether they still want it.

A front end that can wait for a kernel on a thread of its own (geop mcp) sets a watcher around what it asks (watching). The loops that take long tell it how far they are at each turn: a loop that can stop part way and say so asks go_on; one whose answer is nothing unless whole, checkpoint, which fails; one that must finish, a build, report. A watcher decides how much of a question is asked, never what the answer means: a report stopped part way says how far it got. Between two turns nothing is looked at, so a boolean running stops once it is done.

Structs§

Progress
How far a computation is.

Functions§

checkpoint
go_on for an answer that is nothing unless whole: fails, saying how far it got, if it should not go on.
go_on
Tells the watcher how far a loop is: whether it should go on, as it should with none.
report
Tells the watcher how far a computation that must finish is.
watching
Runs f with watcher told how far it is, and asked whether to go on.