diff options
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | guix.scm | 1 | ||||
-rw-r--r-- | mumi/web/server.scm | 15 |
3 files changed, 12 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index a4dbdcf..2442982 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,11 @@ if test "x$have_guile_email" != "xyes"; then AC_MSG_ERROR([guile-email is missing; please install it.]) fi +GUILE_MODULE_AVAILABLE([have_fibers], [(fibers web server)]) +if test "x$have_fibers" != "xyes"; then + AC_MSG_ERROR([Guile fibers is missing; please install it.]) +fi + guilemoduledir="${datarootdir}/guile/site/${GUILE_EFFECTIVE_VERSION}" AC_SUBST([guilemoduledir]) AC_SUBST([GUILE_EFFECTIVE_VERSION]) @@ -100,6 +100,7 @@ Debbugs bug tracker's SOAP service.") (inputs `(("guile-debbugs" ,guile-debbugs-next) ("guile-email" ,guile-email) + ("guile-fibers" ,guile-fibers) ("guile-syntax-highlight" ,guile-syntax-highlight) ("guile" ,guile-2.2.4))) (native-inputs diff --git a/mumi/web/server.scm b/mumi/web/server.scm index 0c1f662..b86ef3b 100644 --- a/mumi/web/server.scm +++ b/mumi/web/server.scm @@ -19,8 +19,8 @@ #:use-module (srfi srfi-1) #:use-module (web http) #:use-module (web request) - #:use-module (web server) #:use-module (web uri) + #:use-module (fibers web server) #:use-module (mumi web controller) #:use-module (mumi web util) #:export (start-mumi-web-server)) @@ -35,13 +35,10 @@ (request-method request) (uri-path (request-uri request))) (apply values - (append - (run-controller controller request body) - (list controller)))) + (run-controller controller request body))) (define (start-mumi-web-server port) - (run-server (lambda args (apply handler args)) - 'http - `(#:addr ,INADDR_ANY - #:port ,port) - controller)) + (run-server (lambda (request body) + (handler request body controller)) + #:addr INADDR_ANY + #:port port)) |