Nio4r 0.2.2 : high performance IO selectors for Ruby

nio4r provides a high performance IO selector API which lets you watch
several IO objects for events using a single system call. It’s similar
to
Kernel.select, but keeps its state between calls:

nio4r has been designed up to have great cross-platform support for both
different operating systems and different Ruby implementations.
Implementations it’s checked regularly on include MRI 1.8.7/1.9.2/1.9.3,
JRuby 1.6, and Rubinius 2.0 (master) on both Linux and OS X.

nio4r is a great tool to use if you want to work with lots of IO objects
in
a single thread but don’t want to use a full-blown framework like
EventMachine or Cool.io. It can also be used to implement frameworks
like
EventMachine and Cool.io (and may be used in the future to reimplement
Cool.io)

The previous announced release was actually 0.1.0, but over the course
of
using nio4r to reimplement the reactor in celluloid-io I discovered a
number of bugs and missing features. Just so you know, 0.2.0 and 0.2.1
were
stealth releases which had various showstopper issues for my purposes :slight_smile:

No benchmarks available yet, sorry. Coming soon! Feel free to benchmark
it
yourself and let me know what numbers you’re getting.

Changes from 0.1.0:

  • NIO::Monitor#readiness API to query readiness, along with #readable?
    and
    #writable? helper methods
  • NIO::Selector#select_each API which avoids memory allocations if
    possible
  • Raise IOError if asked to wake up a closed selector
  • Implement wakeup mechanism using raw pipes instead of ev_async, since
    ev_async likes to cause segvs when used across threads (despite claims
    in the documentation to the contrary)
  • Bugfixes for the JRuby implementation

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs