From: Patrick May Date: 2004-08-31T15:14:29+09:00 Subject: fastcgi & continuations (Re: Idea: Webshare) Hello, I wasn't able to make this continuation trick work for me. It flip flops -- it works the first time, crashes the second time, then mod_fastcgi restarts the process and the cycle repeats. I wish I could make these continuations work, though. Cheers, Patrick On Tuesday, August 24, 2004, at 12:01 AM, T. Onoma wrote: >> Time to make it make sense. > > Thought's this was intersting. On Matz's blog there was this snippet: > > require 'cgi' > require 'fcgi.so' > class CGI > class Fast < CGI > CONTINUATION = [] > def Fast::new(*args) > at_exit do > if CONTINUATION[0] > CONTINUATION[0].call > end > end > callcc do |c| > CONTINUATION[0] = c > end > fcgi = FCGI::accept > unless fcgi CONTINUATION[0] = nil > exit > end > $defout = fcgi.out super(*args) > end > end > end > > Does that make sense? Here's what matz says about it: > > > About how to make correction of the existing CGI program minimum and > make it > FastCGI correspondence > > Before, such a trick has been written. > > [ above code here ] > > I change "require'cgi'" into "require'fcgi'" and think that remarkable > CGI > will operate as it is only by rewriting "CGI.new" to "CGI::Fast.new." > > > T. >