;;;; What [flan dev] launches: a program with a loop, a function to redefine, ;;;; and a way to stop. The daemon overrides the socket path through the ;;;; environment, so the one written here is only what it falls back to. (import agent "vendor:agent") (defvar ticks i64) (defn step [] i64 (set ticks (+ ticks 1)) ticks) (defn main [] i32 (agent/start "/tmp/flan-dev-fallback.sock") (print-i64 (step)) (newline) (while (= (agent/wait 100) 0) 0) (print-i64 (step)) (newline) (while (= (agent/wait 100) 0) 0) (print-i64 (step)) (newline) 0)