diff --git a/racket/syndicate/examples/actor/flip-flop.rkt b/racket/syndicate/examples/actor/flip-flop.rkt index ce59fdb..794a7e7 100644 --- a/racket/syndicate/examples/actor/flip-flop.rkt +++ b/racket/syndicate/examples/actor/flip-flop.rkt @@ -20,9 +20,11 @@ (active-state)))) (inactive-state)) -(spawn (on (asserted (active)) (send! (stdout-message "Flip-flop is active"))) - (on (retracted (active)) (send! (stdout-message "Flip-flop is inactive"))) +(spawn #:name 'monitor-flip-flop + (on (asserted (active)) (send! (stdout-message "Flip-flop is active"))) + (on (retracted (active)) (send! (stdout-message "Flip-flop is inactive")))) +(spawn #:name 'periodic-toggle (field [next-toggle-time (current-inexact-milliseconds)]) (on (asserted (later-than (next-toggle-time))) (send! (toggle))