unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Streaming responses with Guile's web modules
@ 2018-09-18 19:42 Roel Janssen
  2018-09-18 20:08 ` Amirouche Boubekki
  2018-09-23 13:20 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Roel Janssen @ 2018-09-18 19:42 UTC (permalink / raw)
  To: guile-user@gnu.org

Dear Guilers,

I'd like to implement a web server using the (web server) module, but
allow for “streaming” results.  The way I image this would look like,
is something like this:

(define (request-handler request body)
  (values '((content-type . (text/plain)))
          ;; This function can build its response by writing to
          ;; ‘port’, rather than to return the whole body as a
          ;; string.
          (lambda (port)
            (format port "Hello world!"))))

(run-server request-handler)

Is this possible with the (web server) module?  If so, how?
If not, what would be a good starting point to implement this?

Kind regards,
Roel Janssen



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-23 13:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18 19:42 Streaming responses with Guile's web modules Roel Janssen
2018-09-18 20:08 ` Amirouche Boubekki
2018-09-19  8:47   ` Roel Janssen
2018-09-19 15:50     ` Roel Janssen
2018-09-22 13:54     ` Roel Janssen
2018-09-23 13:20 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).