sleepy_penguin provides access to newer, Linux-only system calls to wait
on events from traditionally non-I/O sources. Bindings to the eventfd,
timerfd, inotify, signalfd and epoll interfaces are provided.
I’ve mainly written this to force myself to learn some of the newer
APIs in Linux 2.6 but maybe someone will find them useful one day.
If you’re writing portable software or want something other people use
in production, consider Cool.io or EventMachine instead.
Thread-safe blocking operations under both Ruby 1.8 and 1.9.
IO-like objects are backwards-compatible with IO.select.
Epoll interface is fork-safe and GC-safe
Unlike portable event frameworks, the Linux-only Epoll interface
allows using edge-triggered I/O for possibly improved performance
Fully-documented and user-friendly API
Changes since 1.4.0:
There are many internal cleanups, bugfixes, and incompatible
API changes. The API will probably be stable from now on.
All the flag passing is less verbose, in the past you had
tfd = TimerFD.new(TimerFD::CLOEXEC|TimerFD::NONBLOCK)
Now, you can just do (the old way still works):
tfd = TimerFD.new([:CLOEXEC, :NONBLOCK])
A SignalFD interface now exists, but is not recommended since
MRI signal handling seems to conflict with it.
Inotify#close no longer holds the GVL while closing the
descriptor since it is an expensive operation.
See git log v1.4.0…v2.0.0 for all the gory details.