[Nitro] [PATCH] Prototype ACGI support
kashia at vfemail.net
Sun Jan 15 07:49:45 EST 2006
yesterday I spent half of the day, just to implement ACGI. Result: ACGI seemed nice at first, but on my computer it is unusable. This patch is _not_ for production use, it's only for those who want to experiment with it a bit. Maybe it works better at someone elses computer, I seem to have problems with file locks on my computer (which actually shouldn't happen)
So, for those who want to take a look, this patch doesn't break anything, it just adds another cgi handler.
* copy acgi.c and Makefile.acgi to your public/ folder.
* in public/: make -f Makefile.acgi
* edit your .htaccess file to use acgi.cgi instead of fcgi/cgi.rb
* Then just point your browser to your application.
If you enabled error loggin in Apache, "tail -f" it to get an idea on how your program is doing. What it should doing is: start the Nitro application once (it uses the normal rub.rb) and handle the incoming requests from the browser.
The idea from acgi is quite nice for small applications (if it would work correctly). It creates a server (nitro application) and locks server.lock in /tmp/acgi_ipc/. For each request from the browser it locks client.lock, processes the request and unlocks the client.lock again.
The server will stay started for all requests.
All this is done by the acgi.c program so it works very fast. Blocking lock requests handle concurrent requests.
Well, since I spent this half day getting it to work, maybe someone can make use of it, it may be of educational value for someone, it may even work perfectly for someone.
Have a nice day,
Feel the love
More information about the Nitro-general