syndicate-rkt/syndicate/test/core/self-loop.rkt

14 lines
424 B
Racket
Raw Permalink Normal View History

#lang syndicate
;;; SPDX-License-Identifier: LGPL-3.0-or-later
2024-03-10 11:43:06 +00:00
;;; SPDX-FileCopyrightText: Copyright © 2021-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
(module+ test
2021-06-17 12:57:06 +00:00
(standard-actor-system (ds)
(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))))