Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

Replies are listed 'Best First'.
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(θ)| |
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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2020-10-28 23:25 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (265 votes). Check out past polls.