creating delayed reactor

This commit is contained in:
2026-04-21 13:10:58 +02:00
parent f62d7158bc
commit 472c70660c

View File

@@ -1036,16 +1036,16 @@
(set! value val) (set! value val)
(set! value-set-at (current-milliseconds)) (set! value-set-at (current-milliseconds))
(when (eq? wait-thread #f) (when (eq? wait-thread #f)
(thread (λ () (set! wait-thread (thread (λ ()
(let loop ((vsa value-set-at)) (let loop ((vsa value-set-at))
(sleep seconds) (sleep seconds)
(let ((cms (current-milliseconds))) (let ((cms (current-milliseconds)))
(if (>= (- cms vsa) ms) (if (>= (- cms vsa) ms)
(begin (begin
(set! wait-thread #f) (set! wait-thread #f)
(value-callback value)) (value-callback value))
(loop))))))) (loop)))))))
))) ))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Quitting and waiting ;; Quitting and waiting