RAA - uvrb

uvrb / 0.1.0

Short description: libuv bindings for Ruby
Category: Library/IO
Status: alpha
Created: 2012-05-30 23:24:18 GMT
Last update: 2012-05-30 23:24:18 GMT
Owner: avalanche123 (Projects of this owner)
Homepage: https://github.com/avalanche123/uvrb
Download: not available
License: OpenSource
Dependency:
None
Description:

uv.rb - libuv FFI bindings for Ruby

Build Status

Libuv is a cross platform asynchronous IO implementation that powers NodeJS. It supports sockets, both UDP and TCP, filesystem operations, TTY, Pipes and other asynchronous primitives like timer, check, prepare and idle.

UV.rb is FFI Ruby bindings for libuv.

Usage

Create a uv loop or use a default one

  require 'uv'

  loop = UV::Loop.default
  # or
  # loop = UV::Loop.new

  timer = loop.timer
  timer.start(50000, 0) do |error|
    p error if error
    puts "50 seconds passed"
    timer.close
  end

  loop.run

Find more examples in examples directory

Installation

  gem install uvrb

or

  git clone ...
  cd ...
  bundle install

Make sure you have libuv compiled and a shared library (`.dylib`|`.so`|`.dll`) file available in your lib path.

To compile libuv from a local submodule version:

  git submodule update --init
  rake libuv

Or to compile libuv on mac, you can install provided Homebrew formula by running:

  brew install Formula/libuv.rb --HEAD

What’s supported

  • TCP
  • UDP
  • TTY
  • Pipe
  • Timer
  • Prepare
  • Check
  • Idle
  • Async
  • Filesystem
  • File
  • FSEvent
  • Errors

Edit this project (for project owner)

back to RAA top