http://www.perlmonks.org?node_id=1084540

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(θ)| |

Replies are listed 'Best First'.
Re: Plack and apache child init phase
by sundialsvc4 (Abbot) 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(θ)| |