Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Plack and apache child init phase

by ysth (Canon)
on Apr 30, 2014 at 18:39 UTC ( #1084540=perlquestion: print w/ replies, xml ) Need Help??
ysth has asked for the wisdom of the Perl Monks concerning the following question:

A new server is being developed, mostly by someone other than me, that has some code in a mod_perl child init handler; I'm trying to figure out if it's worthwhile to argue for using a module that expects to be run under Plack instead of reinventing that module's wheel. But I don't see any provision for child init code in Plack or PSGI. Am I missing something?

AFAICT we could just go ahead and use Plack and the child init handler, but that seems contrary to the spirit of PSGI (and would mean special code to enable plackup to work).

I know Starman has a similar child_init_hook; maybe how/if it solves this problem could provide an answer?

--
A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |

Comment on Plack and apache child init phase
Re: Plack and apache child init phase
by sundialsvc4 (Monsignor) on Apr 30, 2014 at 20:25 UTC

    The Plack architecture is simply different in this respect.   You can either do something in the object constructor, or do something the first time through the request-handler method.   In the latter case, the child’s first request will experience a delay.

Re: Plack and apache child init phase
by Anonymous Monk on May 01, 2014 at 03:08 UTC

    that has some code in a mod_perl child init handler

    Sets up some singletons right?

      I'm not really clear on the purpose; I think it's not how I would have approached the problem. But I can certainly think of situations where I would use a child init handler.

      Why do you ask?

      --
      A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1084540]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-09-17 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (96 votes), past polls