2022-08-24 13:53:18 +00:00
|
|
|
#lang scribble/manual
|
|
|
|
@(require (for-label racket))
|
|
|
|
|
2022-08-28 10:27:01 +00:00
|
|
|
@title{poll}
|
|
|
|
|
|
|
|
|
|
|
|
@racketblock[
|
2022-08-24 13:53:18 +00:00
|
|
|
(with-sc3
|
|
|
|
(lambda (fd)
|
|
|
|
(letrec ((print (lambda (e) (display e) (newline)))
|
|
|
|
(showing (lambda (f) (lambda () (let ((v (f))) (print v) v))))
|
|
|
|
(repeat (lambda (f) (if (f) (repeat f) #f))))
|
|
|
|
(async fd (notify 1))
|
|
|
|
(repeat (showing (lambda () (wait fd "/tr"))))
|
2022-08-28 10:27:01 +00:00
|
|
|
(async fd (notify 0)))))
|
|
|
|
]
|
2022-08-24 13:53:18 +00:00
|
|
|
|
|
|
|
|