flan/test/programs/dev-noagent-running.flan

25 lines
1.1 KiB
Plaintext

;;;; A program that has not been told about the agent and is still running.
;;;;
;;;; dev-noagent.flan is the other half of this pair and stops short of it: its
;;;; main returns, so a moment later it is parked, and a redefinition sent to a
;;;; parked program is answered by the parking path. This one keeps running,
;;;; which is the state nothing had pinned: there is no agent in the process to
;;;; hand a module to and no socket to fall back on, so the daemon refuses the
;;;; delivery and says which socket it could not reach.
;;;;
;;;; That is the honest answer for it. A program that *links* the agent has its
;;;; socket bound by the package's constructor before main, so a running
;;;; program with no socket is always this one; see TODO.org, "(agent/start)
;;;; takes no argument, and binds before main".
;;;;
;;;; So: no (import agent ...) anywhere, and a loop that outlasts the test.
(defn step [] i64 7)
(defn main [] i32
(print (step)) (println "")
;; Long enough that the session ends before the program does; short enough
;; that a daemon killed the hard way leaves nothing running for minutes.
(dotimes [i 3000]
(sleep-seconds 0.01))
0)