unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Dmitry Polyakov <liltechdude@gmail.com>
To: guile-user@gnu.org
Subject: Web development without connections to external repl (in geiser)
Date: Sun, 16 Oct 2022 00:23:58 +0500	[thread overview]
Message-ID: <874jw4ki0h.fsf@gmail.com> (raw)


Hello guilers!

As far as I can see, current method for interactive web development is
to connect to external guile-instance-with-listen-option with geiser.

Using fibers, I thought I could run the web server in seperate thread
that dont block current one where, for example, I could rebind the
handler (via ice-9 atomics or something). But it's not, after eval
(run-server handler), repl get stuck. May be I misunderstood something?
This is code:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 atomic)
	     (fibers)
	     (fibers scheduler)
	     (fibers web server))

(define v (make-atomic-box "some text sdf"))

(define (handler request body) (values '((content-type . (text/plain)))
				       (atomic-box-ref v)))


(run-server handler)
--8<---------------cut here---------------end--------------->8---



             reply	other threads:[~2022-10-15 19:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-15 19:23 Dmitry Polyakov [this message]
2022-10-16  4:49 ` Web development without connections to external repl (in geiser) Dmitry Polyakov
2022-10-16  7:12   ` Dr. Arne Babenhauserheide

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jw4ki0h.fsf@gmail.com \
    --to=liltechdude@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).