Split out timer-demo.rkt
This commit is contained in:
parent
bd65204760
commit
7790923e65
|
@ -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!"))))))
|
|
@ -114,10 +114,3 @@
|
||||||
|
|
||||||
(define-syntax-rule (stop-when-timeout relative-msecs body ...)
|
(define-syntax-rule (stop-when-timeout relative-msecs body ...)
|
||||||
(on-timeout relative-msecs (stop-current-facet 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!"))))))
|
|
||||||
|
|
Loading…
Reference in New Issue