aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-data-service/utils.scm')
-rw-r--r--guix-data-service/utils.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index cc9b7ac..8ad60f9 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -111,6 +111,16 @@
(result
(apply values result))))
+(define (fetch-result-of-defered-thunks . reply-channels)
+ (let ((responses (map get-message reply-channels)))
+ (map
+ (match-lambda
+ (('worker-thread-error . exn)
+ (raise-exception exn))
+ (result
+ (apply values result)))
+ responses)))
+
(define-syntax parallel-via-thread-pool-channel
(lambda (x)
(syntax-case x ()
@@ -120,7 +130,7 @@
(lambda ()
e0)))
...)
- (values (fetch-result-of-defered-thunk tmp0) ...)))))))
+ (apply values (fetch-result-of-defered-thunks tmp0 ...))))))))
(define-syntax-rule (letpar& ((v e) ...) b0 b1 ...)
(call-with-values