10.7 Engines
An engine is an abstraction that models processes that can be preempted by a timer or other external trigger. They are inspired by the work of Haynes and Friedman [Haynes84].
The argument to proc is a procedure that takes a boolean, and it can be used to disable suspends (in case proc has critical regions where it should not be suspended). A true value passed to the procedure enables suspends, and #f disables suspends. Initially, suspends are allowed.
The engine-run procedure returns #t if engine’s procedure completes (or if it completed earlier), and the result is available via engine-result. The engine-run procedure returns #f if engine’s procedure does not complete before it is suspended after timeout-secs. If engine’s procedure raises an exception, then it is re-raised by engine-run.
procedure
(engine-result engine) → any
engine : engine
procedure
(engine-kill engine) → void?
engine : engine?