diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2021-07-13 19:47:49 +0200 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-07-13 19:47:49 +0200 |
commit | 6f93654f816ef6e3effcf57fe4360c10688210d4 (patch) | |
tree | 437b18c3c33095eece0be936f45e99c436205650 /src/scm/webid-oidc/program.scm | |
parent | 565bb00d8a355a9fd9c83205381916084f37bb4a (diff) |
Continue the request processing in a new thread if a request needs to
be made
Diffstat (limited to 'src/scm/webid-oidc/program.scm')
-rw-r--r-- | src/scm/webid-oidc/program.scm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/scm/webid-oidc/program.scm b/src/scm/webid-oidc/program.scm index 069c5e8..b613717 100644 --- a/src/scm/webid-oidc/program.scm +++ b/src/scm/webid-oidc/program.scm @@ -23,6 +23,7 @@ #:use-module (webid-oidc resource-server) #:use-module (webid-oidc server create) #:use-module (webid-oidc jti) + #:use-module (webid-oidc offloading) #:use-module ((webid-oidc stubs) #:prefix stubs:) #:use-module ((webid-oidc config) #:prefix cfg:) #:use-module (ice-9 optargs) @@ -57,7 +58,8 @@ (format (current-error-port) "~a: GET ~a ~s...\n" date uri-string headers)) (receive (response response-body) - (http-get uri #:headers headers) + (in-another-thread + (http-get uri #:headers headers)) (with-mutex logging-mutex (format (current-error-port) "~a: GET ~a ~s: ~s ~a bytes\n" date uri-string headers response @@ -170,12 +172,13 @@ (read-client implementation server)) (lambda (client request body) (future - (if client - (receive (response body state) - (handle-request handler request body state) - (write-client implementation server client response body) - state) - state))))) + (with-threads + (if client + (receive (response body state) + (handle-request handler request body state) + (write-client implementation server client response body) + state) + state)))))) (define* (run-server* handler |