summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-02-11 12:33:28 +0100
committerAndy Wingo <wingo@pobox.com>2017-02-11 12:34:48 +0100
commit80d68a29f5434fd5055c819ee1d84bdc4cce0477 (patch)
treecd0f5223372f6ec13c9c1158a81e3847604159bd /examples
parentAdd condition variable implementation (diff)
downloadguile-fibers-80d68a29f5434fd5055c819ee1d84bdc4cce0477.tar.gz
Add concurrent web server
* fibers.texi (Concurrent Web Server): New section. * fibers/web/server.scm: Add web server that can run handlers concurrently. * examples/concurrent-web-hello.scm: New file. * Makefile.am (SOURCES): Add (fibers web server).
Diffstat (limited to 'examples')
-rw-r--r--examples/concurrent-web-hello.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/concurrent-web-hello.scm b/examples/concurrent-web-hello.scm
new file mode 100644
index 0000000..29ed102
--- /dev/null
+++ b/examples/concurrent-web-hello.scm
@@ -0,0 +1,7 @@
+(use-modules (fibers web server))
+
+(define (handler request body)
+ (values '((content-type . (text/plain)))
+ "Hello, World!"))
+
+(run-server handler)