It makes perfectly good sense ;o)
To be honest, while I have got a play setup going now, I haven't had a chance to do a real close look at the code.
GENERALLY what I've found WRT web based applications is that they lack sufficiently generalized session management, authentication/authorization, and request/response management to be easily modified. Unfortunately most of that is in the nature of the beast.
For the work I've been doing the last couple years I built classes to abstract that stuff into what amounts to a publishing system. Unfortunately you are correct about complexity and manageability. Its not a dirt simple system to use!
As for fastCGI, its really pretty simple. Your application runs as a stand alone long-lived process, and the web server simply uses mod_fastcgi to send it requests via a Unix domain or TCP socket. Fast::CGI is one perl module you can use to work with it. Basically it is identical to the standard CGI.pm module. Each request looks exactly like a CGI invocation to your code, except you sit in a loop looking for requests, like:
while(my $req = new Fast::CGI())
You can take an existing CGI.pm based app and just stick basically those lines at the top and encapsulate the rest of the script logic in handle_request() and have a fastCGI! Of course like with mod_perl your script lives beyond one request and so you have variables that can retain state etc. The tricky part is that of course a single fastCGI process is basically a daemon that can handle only one request at a time...
You can have many load balanced copies of the same process (mod_fastcgi handles the dispatching) but then you have the "session affinity" problem if you maintain state in variables (can't guarantee the same process handles all of user X's requests). Some tiresome fiddling with mod_rewrite can fix that, but its ugly!
My answer was to use perl 5.6 and use multi-threading. So the "handle_request()" function spawns a thread which does the request handling, while the main loop thread goes back to waiting for a new request, which seems to work awesome, but of course now you have to be thread safe!
Anyway, I'll take a good look at the scoop source this week and maybe I can throw in a patch or two that will make it possible to run in fastCGI, though I suspect it will basically mean abstracting a few things.
That is not dead which may eternal lie
And with strange aeons death itself may die.
[ Parent ]