RosettaCodeData/Task/Events/Racket/events.rkt
Ingy döt Net 776bba907c Sync
2013-10-27 22:24:23 +00:00

8 lines
273 B
Racket

#lang racket
(define task (thread (lambda () (printf "Got: ~s\n" (thread-receive)))))
(thread-send task ; wait for it, then send it
(sync (alarm-evt (+ 1000 (current-inexact-milliseconds)))))
(void (sync task)) ; wait for the task to be done before exiting