Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question on design for FastCGI
by Anonymous Monk on Oct 15, 2012 at 15:54 UTC | |
by Anonymous Monk on Oct 16, 2012 at 13:18 UTC | |
by Anonymous Monk on Oct 17, 2012 at 00:48 UTC | |
by Anonymous Monk on Oct 17, 2012 at 16:04 UTC | |
by Anonymous Monk on Oct 18, 2012 at 05:18 UTC | |
| |
|
Re: Question on design for FastCGI
by locked_user sundialsvc4 (Abbot) on Oct 15, 2012 at 17:22 UTC |