[dev] add/del timer ?

Brice Figureau brice+nginx at daysofwonder.com
Thu Oct 4 00:57:13 MSD 2007


Is there a possibility to setup a timer to expire after a timeout that
calls a callback in an http nginx module ?

I saw some timer related functions in ngx_event_timer.c but I'm not sure
how to use it...

Is the following (untested) code right?

static ngx_event_t ngx_timer;

    ngx_timer.handler = <my callback>;
    ngx_timer.log = r->log;
    ngx_timer.data = <data to send to the callback>;

    ngx_add_timer(&ngx_timer, <timeout>);

Brice Figureau

More information about the nginx mailing list