aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-03-23 10:26:14 +0000
committerChristopher Baines <mail@cbaines.net>2024-03-23 10:26:14 +0000
commit1f8966670071eb0685a7dcee2ee3c70e8fecb051 (patch)
treea8c4cdf047aa45fa5570a9e564e0dbed0dac7632
parent22d2e260a6ee7a28e635ac9a60b18cc9cdf8ba7e (diff)
downloadnar-herder-1f8966670071eb0685a7dcee2ee3c70e8fecb051.tar
nar-herder-1f8966670071eb0685a7dcee2ee3c70e8fecb051.tar.gz
Remove with-fibers-timeout
As it's unused.
-rw-r--r--nar-herder/utils.scm38
1 files changed, 0 insertions, 38 deletions
diff --git a/nar-herder/utils.scm b/nar-herder/utils.scm
index 26d10bc..4755d33 100644
--- a/nar-herder/utils.scm
+++ b/nar-herder/utils.scm
@@ -66,7 +66,6 @@
run-server/patched
timeout-error?
- with-fibers-timeout
port-read-timeout-error?
port-write-timeout-error?
@@ -654,43 +653,6 @@ If already in the worker thread, call PROC immediately."
(sigaction SIGPIPE SIG_IGN)
(spawn-fiber (lambda () (socket-loop socket handler))))))
-(define &timeout
- (make-exception-type '&timeout
- &external-error
- '(thunk)))
-
-(define make-timeout-error
- (record-constructor &timeout))
-
-(define timeout-error?
- (record-predicate &timeout))
-
-(define* (with-fibers-timeout thunk #:key timeout)
- ;; Maybe there's a way of doing this directly with operations, and
- ;; without the channel and fiber?
- (let ((channel (make-channel)))
- (spawn-fiber
- (lambda ()
- (call-with-values
- (thunk)
- (lambda vals
- (perform-operation
- (choice-operation
- (put-operation channel vals)
- ;; I don't know if this is useful to avoid just forever
- ;; waiting to write to channel, but maybe it is
- (sleep-operation timeout)))))))
- (perform-operation
- (choice-operation
- (wrap-operation
- (get-operation channel)
- apply)
- (wrap-operation
- (sleep-operation timeout)
- (lambda ()
- (raise-exception
- (make-timeout-error thunk))))))))
-
;; These procedure are subject to spurious wakeups.
(define (readable? port)