Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

epoll, kqueue, /dev/poll .... extensions for PHP

Tags:

php

events

epoll

Is there a PHP extension (stability is irrelevant) that allows for direct epoll, kqueue, /dev/poll polling functions without going through libevent or libev extensions?

like image 850
Nick Avatar asked Mar 07 '12 16:03

Nick


1 Answers

Inotify

You don't specify what architectures should be supported by the extension. But if Linux-only is an option you can use inotify, which:

  • seems to have a more stable extension
  • provides similar functionality.

php-inotifytools is a another possible extension.

Here is an extensive, self-contained article showing how inotify works and how to use the C API.

Additionally, judging by by the conclusion of Robert Love's article: Intro to inotify, inotify has a very good performance:

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 is a well respected Linux kernel hacker, and author of the reference book Linux Kernel Development (which I happen to own).

like image 55
fons Avatar answered Oct 23 '22 04:10

fons