On 6/28/06, Thomas Chust <[EMAIL PROTECTED]> wrote:
On Wed, 28 Jun 2006, felix winkelmann wrote:> On 6/28/06, jbarciela jbarciela <[EMAIL PROTECTED]> 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
Thanks Thomas and Felix, For some reason I was assuming scgi needed to run the show and start a REPL somehow and not the other way around. I guess that's because I haven't studied what scgi (the protocol, not the egg) is supposed to do. I found this description: http://python.ca/nas/scgi/protocol.txt, but it only address the data format, it doesn't talk about what services (if any) scgi provides. I have seen articles (http://www.mems-exchange.org/software/scgi/; http://www.zedshaw.com/projects/scgi_rails/) talking about clusters, starting new processes/threads, etc; are those things specified in scgi itself or you have to do them by hand if you need them? Do you guys know of a better (more complete) description of scgi that I can read? Anyway, I tried making the thread myself, but make-thread is unbound. I noticed that srfi-18 is not an egg, and it doesn't show up if I enter ",r" in csi. Does that means that I have to compile my own chicken? Jaime _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
