[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FCGI: How do you use it?

Tom Allison

7/25/2006 10:29:00 AM

I'm kind of perplexed here so I'll ask the stupid questions.

When I use perl and call for a CGI module, I get with it all kinds of really
cool abilities related to %ENV and STDIN/STDOUT and the ability to even set
cookies...

I can't find much of anything about what FCGI/FastCGI offers in terms of methods
or properties that are similar..

Is it correct to assume that FCGI doesn't do any of this and if I'm interested
in any kind of CGI related functionality (headers, cookies, %ENV...) then I
should probably just load the CGI modules?

Now onto the Ruby specific nature of the question, but if anyone here knows the
perl-specific question above I would also appreciate it:

Is there some way I can run the ruby fcgi scripts from command line to test?
Editing and restarting apache all the time is not very fun.

Under ruby should I load fcgi, cgi, cgi/cookie, cgi/session rather
than expecting any of this kind of insight into the HTTP process from the FCGI
working environment? (please don't take any of these negative questions to be a
slight on FCGI/FastCGI

It's a stupid question but I would feel stupider if I found I was loading
multiple modules when only one was required. I haven't really found anything
that tells me that fcgi does other than some rudimentary examples. (or is it
that simple and I'm just trying to make it complicated?)

Simply put, I can't seem to find any way to discover what fcgi provides under
ruby (variables, methods). But I would like to use it and understand that many do.

The documentation around the whole FastCGI thing is either very slim or hard to
find. I did not find the whitepaper a very encouraging read since I'm not
designing an HTTP server. I'm trying to be a user of the product.

3 Answers

Ara.T.Howard

7/25/2006 2:33:00 PM

0

Tom Allison

7/25/2006 5:44:00 PM

0


>the key is that fcgi hands you a cgi-like object and that object __is__ documented.

this is "key". I now have some direction in which to go play. Thank
you.

Should I assume that

fcgi.each do |request|

returns something akin to perls http::request object (useble but
clunkier) and

fcgi.each_cgi do |cgi|

returns a CGI object with is easier to code with.

Since it loads CGI anyways, there really isn't any memory savings on
either of these approaches, but little things can be handled with
'requests' probably faster than if they are treated as cgi objects.

Thank you.

Ara.T.Howard

7/25/2006 5:47:00 PM

0