Split out timer-demo.rkt

This commit is contained in:
Tony Garnock-Jones 2021-06-10 13:30:30 +02:00
parent bd65204760
commit 7790923e65
2 changed files with 13 additions and 7 deletions

View File

@ -0,0 +1,13 @@
#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+ main
(actor-system/dataspace (ds)
(spawn-timer-driver ds)
(spawn (at ds
(log-info "waiting...")
(stop-when-timeout 2000
(log-info "done!"))))))

View File

@ -114,10 +114,3 @@
(define-syntax-rule (stop-when-timeout relative-msecs body ...)
(on-timeout relative-msecs (stop-current-facet body ...)))
(module+ main
(actor-system/dataspace (ds)
(spawn-timer-driver ds)
(spawn (at ds
(stop-when-timeout 2000
(log-info "hi!"))))))