From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Roel Janssen Newsgroups: gmane.lisp.guile.user Subject: Streaming responses with Guile's web modules Date: Tue, 18 Sep 2018 21:42:31 +0200 Message-ID: <87in32y4m0.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1537299674 9031 195.159.176.226 (18 Sep 2018 19:41:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2018 19:41:14 +0000 (UTC) User-Agent: mu4e 1.0; emacs 26.1 To: "guile-user\@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 18 21:41:10 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g2Lrx-0002FA-UC for guile-user@m.gmane.org; Tue, 18 Sep 2018 21:41:10 +0200 Original-Received: from localhost ([::1]:42306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2Lu4-0005Xm-90 for guile-user@m.gmane.org; Tue, 18 Sep 2018 15:43:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2LtW-0005We-2m for guile-user@gnu.org; Tue, 18 Sep 2018 15:42:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2LtS-0000aS-4R for guile-user@gnu.org; Tue, 18 Sep 2018 15:42:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2LtO-0000Vz-GX for guile-user@gnu.org; Tue, 18 Sep 2018 15:42:40 -0400 Original-Received: from ip112-245-209-87.adsl2.static.versatel.nl ([87.209.245.112]:62039 helo=yellowstone) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1g2LtO-0004tx-1w for guile-user@gnu.org; Tue, 18 Sep 2018 15:42:38 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14885 Archived-At: Dear Guilers, I'd like to implement a web server using the (web server) module, but allow for =E2=80=9Cstreaming=E2=80=9D 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 ;; =E2=80=98port=E2=80=99, rather than to return the whole body a= s 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