是否有允许直接 epoll、kqueue、/dev/poll 轮询功能而无需通过 libevent 或 libev 扩展的 PHP 扩展(稳定性无关紧要)?
最佳答案
通知
您没有指定扩展程序应支持哪些架构。但是如果 Linux-only 是一个选项,你可以使用 inotify ,其中:
- 似乎有一个更稳定的extension
- 提供类似的功能。
php-inotifytools是另一种可能的扩展。
这里是 an extensive, self-contained article展示 inotify 如何工作以及如何使用 C API。
此外,根据 Robert Love 文章的结论判断:Intro to inotify , inotify 有很好的表现:
inotify is a simple yet powerful file change notification system with an intuitive user interface, excellent performance, support for many different events and numerous features. inotify is currently in use in various projects, including Beagle, an advanced desktop indexing system, and Gamin, a FAM replacement.
Robert Love是一位备受尊敬的 Linux 内核黑客,也是引用书的作者 Linux Kernel Development (我碰巧拥有)。
关于php - epoll, kqueue,/dev/poll .... PHP 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9605888/