syndicate-rkt/syndicate/test/core/during-with-spawn.rkt

18 lines
538 B
Racket

#lang syndicate
;;; SPDX-License-Identifier: LGPL-3.0-or-later
;;; SPDX-FileCopyrightText: Copyright © 2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
(require syndicate/drivers/timer)
(module+ test
(standard-actor-system (ds)
(spawn (at ds
(assert 'item)
(on (timeout 50) (stop-current-facet))))
(spawn #:daemon? #t
(at ds
(during/spawn 'item
#:name 'item-handler
(on-start (log-info "up"))
(on-stop (log-info "down")))))))