[dev] can't add timer in a module postconf init routine.

Manlio Perillo manlio_perillo at libero.it
Mon Oct 8 21:43:38 MSD 2007


Brice Figureau ha scritto:
> Hi,
> 
> I tried to ngx_add_timer the postconfiguration init callback of a module,
> but it doesn't work because ngx_event_timer_init has not yet been called.
> 
> Is it possible to call ngx_event_timer_init _before_ the configuration
> phase ends ?
> 
> My only other alternative is to lazily add my timer in the handler
> callback if not set yet (that works fine for sure, but I'm not sure there
> won't be race which could create more timer than I need if there are
> multiple workers).
> 

What do you need to do with the timer?
Your code in configuration callbacks will be inherited by all the worker 
processes

As an example you can use the init process callback in your ngx_module_t 
definition.

> Thanks,


Regards  Manlio Perillo





More information about the nginx mailing list