# Async notification in Nginx

**URL:** <https://www.ruby-forum.com/t/async-notification-in-nginx/228883>\
**Category:** NGINX\
**Created:** [May 11, 2013, 3:38am UTC](https://www.ruby-forum.com/t/async-notification-in-nginx/228883 "2013-05-11T03:38:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alder\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71c47a/32.png) [@Alder\_N](https://www.ruby-forum.com/u/Alder_N)\
**Post date:** [May 11, 2013, 3:38am UTC](https://www.ruby-forum.com/t/async-notification-in-nginx/228883/1 "2013-05-11T03:38:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alder\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/71c47a/32.png) [@Alder\_N](https://www.ruby-forum.com/u/Alder_N)\
**Post date:** [May 13, 2013, 11:35pm UTC](https://www.ruby-forum.com/t/async-notification-in-nginx/228883/2 "2013-05-13T23:35:40Z")

</div>

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?
