Yelp / zygote

A Python HTTP process management utility.
http://opensource.yelp.com/
Apache License 2.0
40 stars 15 forks source link

Invoke pre-fork initialization function. #12

Closed jnb closed 12 years ago

jnb commented 13 years ago

Make the zygote invoke a user-defined initialization function prior to forking off workers.

The use-case is for loading a data file whose location is specified in a config file. Doing this pre-fork means that the data is loaded just once, and we get the benefits of copy on write.

jnb commented 13 years ago

Cool, I've made the initialize function optional; if it's there then it gets called, if not then the behaviour is unchanged.