[mod_python] Child process init handler

Gregory (Grisha) Trubetskoy grisha at modpython.org
Tue Jan 27 16:08:47 EST 2004


Apache doesn't really lend itself to this kind of thinking. I've never
been able to clearly pinpoint what the problem is, but it basically has to
do with a lot of request parameters being generated on the fly as a result
of the combination of the particular's of the request and the apache
configuration directives applicable to that request (which too are
determined at runtime).

Or, to put it another way - Apache's approach is "reactive" rather than
"proactive". When it parses its config it takes very little action on the
things it sees in it. Virtual servers just get piled into a hash list, and
only when a request for that particular server comes in is a meaningful
combination of a server and request object created. It's not like it
"intializes" virtual servers at any point during start up, so there is no
"virtual server init" hook.

In theory, when a child is spawned, mod_python could try to walk the
config and try to make sense of it and create and call some sort of a
per-server init hook, but that would more trouble than it's worth IMO.

Grisha

On Tue, 27 Jan 2004, Michael C. Neel wrote:

> What I want to do:
>
> 	Run some initialization code when Apache spawns the child
> process.  I do not want to call this handler for every request, but I do
> want to have access to the configuration, specifically PythonOptions
>
> In looking though the docs, I'm not sure PythonInitHandler works this
> way, and PythonImport may not be able to access the PythonOption
> directives.  Is there something I'm overlooking?
>
> Mike
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list