chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] repl with scgi?


From: Thomas Chust
Subject: Re: [Chicken-users] repl with scgi?
Date: Wed, 28 Jun 2006 13:09:57 +0200

On Wed, 28 Jun 2006, felix winkelmann wrote:

On 6/28/06, jbarciela jbarciela <address@hidden> wrote:

[...] I used scgi-example.scm as a starting point and just called scgi:add-resource with my own functions. My question is: is there a way to have a REPL in such an environment and modify the web app incrementally without restarting the scheme process? (given the fact that (scgi-server #t) doesn't return)

What I usually do, is start the server in a separate thread. I don't
know how scgi is implemented, but it works fine (well, most of
the time) with the chicken web-server. [...]

Hello,

as I wrote the code, I know how it is implemented and I can tell you that Felix's suggestion should work unless you fiddle around manually with the contents of the scgi:resources parameter :-)

Just do something like

    (require-extension (srfi 18) scgi)

    (define scgi-server-thread
      (make-thread
        (lambda ()
          (scgi-server #t))
        'scgi-server))

    (thread-start! scgi-server-thread)

in csi and continue to use the prompt normally.

I remember faintly, though, that under some operating systems the standard input port in csi is blocking, causing background threads to run only while csi is not waiting for input, which kind of defeats the whole point of this exercise... If you experience such problems, you may want to give the nbstdin egg a try.

cu,
Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]