ffi-rxs

by Chris Duncan

DESCRIPTION:

This gem wraps the Crossroads I/O networking library using the Ruby FFI (foreign function interface). It’s a pure Ruby wrapper so this gem can be loaded and run by any Ruby runtime that supports FFI. That’s all of them: MRI 1.9.x, Rubinius and JRuby.

Crossroads I/O is a fork of ZeroMQ. This gem is a re-working of the ffi-rzmq gem created by Chuck Remes to provide bindings for the Crossroads I/O libxs C library instead of the ZeroMQ libzmq library. The gem auto-configures itself to expose the API conforming to the loaded C library.

FEATURES/PROBLEMS:

This gem needs to be tested in the wild. Please kick its tyres and give it a good thrashing. It is inevitable that bugs will be discovered, so please open issues for them here or fork this project, fix them, and send me a pull request.

The ‘ffi’ gem has dropped support for MRI 1.8.x. Since this project relies on that gem to load and run this code, then this project does not support MRI 1.8.x. I recommend JRuby for the best performance and stability.

REQUIREMENTS:

* Crossroads I/O version 1.0.0 or later.

The Crossroads I/O library must be installed on your system in a well-known location like /usr/local/lib. This is the default for new Crossroads I/O installs.

Future releases may include the library as a C extension built at time of installation.

* ffi (>= 1.0.0)

Do not run this gem under MRI with an old ‘ffi’ gem. It will crash randomly and you will be sad.

INSTALL:

A full gem has been released to Rubygems.org as of release 1.0.0. Make sure the Crossroads I/O library is already installed on your system.

% gem install ffi-rxs # should grab the latest release

To build from git master:

% git clone git://github.com/celldee/ffi-rxs
% cd ffi-rxs
% gem build ffi-rxs.gemspec
% gem install ffi-rxs-*.gem

NOTE for Windows users! In order for this gem to find the libxs.dll, it must be on the Windows PATH. Google for “modify windows path” for instructions on how to do that if you are unfamiliar with that activity.

LICENSE:

(The MIT License)

Copyright © 2011 - 2012 Chuck Remes, Chris Duncan and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.