Async notification in Nginx

I am writing a Niginx module that from several of worker threads
that I created by own, I need to notify Nginx’s main thread so
the main thread (single-threaded nginx) doesn’t need to poll
periodically in timer context. What would be the reliable way to
do that in Nginx? Anybody advice would be appreciated.

  • Alder

By browsing the source code, it seems ngx_event_t can be
used for this purpose, but looks like ngx_event_t has to be
associated with ngx_connection_t, does ngx_connection_t
have to be a socket, or a regular file descriptor will do? Is there
any forum for wrting nginx modules?