best approach for content phase handler to run again with event timer & ngx_done?

bfranks781 at gmail.com bfranks781 at gmail.com
Fri May 30 21:27:36 UTC 2014


If a content phase handler needs to wait on some potentially delayed
result, my understanding is that it should return NGX_DONE so that it is
called again.

I've been reading through the eval, echo, and http_limit_req modules to see
how to integrate an nginx_add_timer event prior to returning NGX_DONE.  A
short timer event seems reasonable, because the content phase handler isn't
waiting on some other event type (subrequest result, timeout, etc).  The
timer event seems fairly straight-forward -- configure the event in a
request context and set the event handler, data and log.

I don't really want my timer event handler to do anything -- rather I just
want the same content phase handler that had previously returned NGX_DONE
to run again.  In that case, should my timer event handler actually do
anything at all?  Is there a best practice for this -- i.e. have it point
to the write_event_handler(), call ngx_http_core_run_phases() or
ngx_http_run_posted_requests(), etc?

Thank you,

Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20140530/9b20a43d/attachment.html>


More information about the nginx-devel mailing list