[Factor-talk] FUEL listener running web page

2010-08-15 Thread Jim mack
Hi, I've got FUEL working w/listener, on Mac, factor version = yesterday's
binaries.  I'm launching a furnace website.

If I launch it from Factor listener directly, it executes but locks the
listener, and I have to restart it.  (Once I've restarted it, I can modify
source, hit F2 and the website reflects those changes, and if I call the
launching word again, it no longer locks the listener - only the first
time.)  If this seems just too weird, see my explanation below.

If I launch from aquamacs, the same thing happens, but I don't know how to
restart the listener.  If I launch it from aquamacs listener in a thread, it
serves the website but I don't know how to get it to refresh its code.

Is there a way to work interactively whereby C-c C-r will update my
website's code, just as I can do in the factor listener?

Thanks,
Jim

What's launching the website, in case I'm causing this problem:

: 4eyes-web ( -- )
[ route-and-return ] to: trick-to-get-reloading
4eyes
[ 4eyes-responder
4eyes-db alloy
init-4eyes-dbs
main-responder set-global
8080 httpd ] with-logging ;

It probably isn't important, but just in case, I know it's non standard and
I have my doubts I'd try it again, but I use one action and have it parse
the request's url  params to decide what to do, from within the display
slot, and that's what trick-to-get-reloading is.  Until I did this, I didn't
seem to get the website code refreshed just by hitting F2, unless I directly
called 4eyes-web again (it was early in my learning curve, so maybe I just
got something wrong, but it's working).
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] FUEL listener running web page

2010-08-15 Thread Slava Pestov
On Sun, Aug 15, 2010 at 9:47 PM, Jim mack j...@less2do.com wrote:
 Hi, I've got FUEL working w/listener, on Mac, factor version = yesterday's
 binaries.  I'm launching a furnace website.

 If I launch it from Factor listener directly, it executes but locks the
 listener, and I have to restart it.  (Once I've restarted it, I can modify
 source, hit F2 and the website reflects those changes, and if I call the
 launching word again, it no longer locks the listener - only the first
 time.)  If this seems just too weird, see my explanation below.

The 'httpd' word does not return until the HTTP server stops running.
So what you should do is launch it in a thread,

[  httpd ] in-thread

 If I launch from aquamacs, the same thing happens, but I don't know how to
 restart the listener.  If I launch it from aquamacs listener in a thread, it
 serves the website but I don't know how to get it to refresh its code.

 Is there a way to work interactively whereby C-c C-r will update my
 website's code, just as I can do in the factor listener?

Separate the part that sets main-responder and the part that starts
httpd into two words. Then to refresh your web site, reload your code
with refresh-all, and re-invoke the word that sets up main-responder.
If the HTTP server is still running, subsequent requests will invoke
your new actions.

Slava

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk