Hi!
I've done something completely useless, nevertheless I want to get it done completely.
I have built a PHP-script/Seaside wiring which works like the WAModLisp-Connector. I made the counter example run, but I'm stuck now. The reason is that the counter gets display properly, but every link I click says that the page is expired. Where should I search?
Regards, Markus
On Saturday, August 30, 2003, at 12:21 AM, Markus Fritsche wrote:
Hi!
I've done something completely useless, nevertheless I want to get it done completely.
I have built a PHP-script/Seaside wiring which works like the WAModLisp-Connector. I made the counter example run, but I'm stuck now. The reason is that the counter gets display properly, but every link I click says that the page is expired. Where should I search?
Can you tell us more about how the wiring works?
My guess is that the URLs in the links may be getting corrupted somehow - "expired" basically just means "I don't know this URL".
Avi Bryant wrote:
Can you tell us more about how the wiring works?
Sure. I have a php-script that takes all the data (cookie, get-request, ...), serializes it, then sends that to my server. The server then creates an appropriate WARequest object and does the invocation of seaside similiar to the WAKom class.
The computation is done in seaide, and the whole thing is send back to the php script, which outputs the result. Headers are set correctly.
My guess is that the URLs in the links may be getting corrupted somehow - "expired" basically just means "I don't know this URL".
Hmm, I've change the paths of the applications from /seaside to /~mfritsche/echo.php and the basepath by hand - I should start with a fresh image :-)
The thing is an experiment; I want to start a minimal image, let it run, and then it shut down after two minutes of inactivity. First I tried with GNU Smalltalk (got the ContinuationTest to work, TestUUDIGenerator). But possible license issues made me thought; so I stayed at the level of a couple of DoIts... With a minimal image and a minimal VM, however, I think Squeak/Seaside aren't to bad for my half-cgi-based experiments - the weblog system I'm using at the moment is vanilla, and that comes up to >3M cgi-loading (rebol) per page hit too.
On Sat, 30 Aug 2003, Markus Fritsche wrote:
Hmm, I've change the paths of the applications from /seaside to /~mfritsche/echo.php and the basepath by hand - I should start with a fresh image :-)
Ok, I'm sure this is where the problem lies. If you're getting to "page expired", then it must be finding the session ok, but the last segment (the action key) of the URL must be wrong. Try tracing through Session>>handleRequest: (I think that's the right method) and see what happens.
Feel free to send me the code if you want and I'll try to take a look at it.
The thing is an experiment; I want to start a minimal image, let it run, and then it shut down after two minutes of inactivity.
That's an interesting approach. Do you save the image when you shut it down, I guess? Does the PHP script start the image up for you if needed?
Avi Bryant wrote:
Hmm, I've change the paths of the applications from /seaside to /~mfritsche/echo.php and the basepath by hand - I should start with a fresh image :-)
Ok, I'm sure this is where the problem lies. If you're getting to "page expired", then it must be finding the session ok, but the last segment (the action key) of the URL must be wrong. Try tracing through Session>>handleRequest: (I think that's the right method) and see what happens.
Feel free to send me the code if you want and I'll try to take a look at it.
I found it: I had to translate the fields dictionary keys to string. Now it works. I also built an own dispatcher, overiding WADispatcher>>#initialize.
The thing is an experiment; I want to start a minimal image, let it run, and then it shut down after two minutes of inactivity.
That's an interesting approach. Do you save the image when you shut it down, I guess? Does the PHP script start the image up for you if needed?
Yes, I basically, I had the following idea: 1. The browser is pointed to .../echo.php/seaside/paths 2. The php-script tries to establish communication to localhost:19995 2.1.1. if not successful start the vm 2.1.2. wait (1, 2 seconds) 2.1.3 retry localhost:19995, start communication 3. set a timer of say, two or three minutes. Reset on activity. If the timer says that it's time to sleep, save the image. A problem is the race condition on image saving. Maybe lockfiles would do the trick?
I've done the same with GNU Smalltalk; it was a bit tricky 'cause the GNU Smalltalk vm crashes if the image isn't saved from the main process (Processor gets messed up). I don't know if it is the same in squeak?
Regards, Markus
On Sat, 30 Aug 2003, Markus Fritsche wrote:
Yes, I basically, I had the following idea:
- The browser is pointed to .../echo.php/seaside/paths
- The php-script tries to establish communication to localhost:19995
2.1.1. if not successful start the vm 2.1.2. wait (1, 2 seconds) 2.1.3 retry localhost:19995, start communication 3. set a timer of say, two or three minutes. Reset on activity. If the timer says that it's time to sleep, save the image.
This is interesting, although I don't quite see the point with just one image - what resources are you saving by quitting the VM, that the OS wouldn't reclaim anyway when it was idle? However, if the image was small enough, I can see doing this with one image/session (or group of sessions). That way you would never have to expire sessions, you would just keep the image files on disk (or at least you could expire them much more slowly).
A problem is the race condition on image saving. Maybe lockfiles would do the trick?
Well, you should only be saving the image on inactivity, so there shouldn't ever be a race condition, right? Just have some semaphore that tracks the number of open requests, and only save the image when it's at 0.
I've done the same with GNU Smalltalk; it was a bit tricky 'cause the GNU Smalltalk vm crashes if the image isn't saved from the main process (Processor gets messed up). I don't know if it is the same in squeak?
No, you shouldn't have that problem.
Avi Bryant wrote:
This is interesting, although I don't quite see the point with just one image - what resources are you saving by quitting the VM, that the OS wouldn't reclaim anyway when it was idle?
My site resides at a server where the people have forgotten me. I've wrote them why they aren't billing and what fee I have to pay (summed up). They didn't react; so I thought if I experiment with custom server techniques, it should be as silent as possible :-) Anyway, I'm building up reserves if they decide to bill at last and backup my weblog regularly.
I don't know if it is the same in squeak?
No, you shouldn't have that problem.
Good to hear.
Regards, Markus
seaside@lists.squeakfoundation.org