RE: how do I do FCGI_Accept() loop?
"Ron Rudman" <ron-owPOFGT/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <007e01c6011b$8c5763c0$6501a8c0@RONDESKTOP> |
There seem to be examples of fastcgi processes written in everything *but* PHP! Is there no sample out there anywhere or is it just not a good idea for some reason? -----Original Message----- From: fastcgi-developers-bounces+ron=rudman.org-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org [mailto:fastcgi-developers-bounces+ron=rudman.org-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org] On Behalf Of Jon Ribbens Sent: Wednesday, December 14, 2005 8:24 AM To: Rares Marian Cc: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org Subject: Re: [FASTCGI] how do I do FCGI_Accept() loop? Rares Marian <[email protected]> wrote: > I know how to get it to work in perl and C. How does it work in PHP or > Ruby or Python? > > Preferably the PHP solution is what I'm looking for. > > Something like while FGCI_Accept()>=0 { $count=$count+1; echo $count; }. Don't know about PHP (I don't think it works like that - it does the Accept stuff for you), but in Python you could use my fcgi.py module (http://jonpy.sf.net/) and the code would be: count = 0 class Handler(cgi.Handler): def process(self, req): global count count += 1 fcgi.Server({fcgi.FCGI_RESPONDER: Handler}).run() (effectively the 'Accept' loop is inside the fcgi.Server.run method) (NB the 'count += 1' may well not be thread-safe) ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/