2021-06-17 11:38:30 +00:00
|
|
|
#lang syndicate
|
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
|
|
|
|
|
|
|
(module+ test
|
2021-06-17 12:57:06 +00:00
|
|
|
(standard-actor-system (ds)
|
2021-06-17 11:38:30 +00:00
|
|
|
(spawn
|
|
|
|
(define (loop n)
|
|
|
|
(log-info "loop ~v" n)
|
|
|
|
(when (positive? n)
|
|
|
|
(react (on-start (send! ds (- n 1)))
|
|
|
|
(at ds (stop-on (message $n) (loop n))))))
|
|
|
|
(loop 5))))
|