Hi,
Reference: CGI or CGI::Fast (Thanks again for all the replies :)).
I've just begun to get a little hang of FastCGI via CGI::Fast. I wasn't used to persistence so the starting part was hard for me. I also found that my existing plain CGI code broke when I tried to convert some of it to run on FastCGI, as part of my exploration.
I've a little question at this toying stage and would like to seek your advice.
I'm wondering if it's better to have a FastCGI-aware main (dispatch) script that distributes the real work to modules, or have individual FastCGI-aware scripts that run independently?
Here's an outline of the two approaches:
Approach 1: Have a main script (e.g. main.fcgi) that distributes work +to modules #!/usr/local/bin/perl -T use Module1; use Module2; use Module3; code to initialise variables while (my $q = new CGI::Fast) { code to distribute job to Module1, Module2 or Module3 } Approach 2: Three FastCGI-aware scripts named module1.fcgi (functional +ly equivalent to Module1), module2.fcgi (functionally equivalent to M +odule2) and module3.fcgi (functionally equivalent to Module3). Each o +f these scripts have more or less the same structure: #!/usr/local/bin/perl -T code to initialise variables while (my $q = new CGI::Fast) { code to run }
Which of these is the better approach with respect to FastCGI?
Thanks for reading and I look forward to your replies!
In reply to Question on design for FastCGI by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |