Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby bindings for libuv

tree: 3fc40ac10b

Fetching latest commit…

Cannot retrieve the latest commit at this time


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.


Create a uv loop or use a default one

require 'uv'

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

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

Find more examples in examples directory


gem install uvrb


git clone ...
cd ...
bundle install

Make sure you have libuv compiled and a .dylib file available in your lib path.

To compile libuv with .dylib, you can install provided Homebrew formula by running:

brew install Formula/libuv.rb --HEAD

or, to compile from a local submodule version:

git submodule update --init
rake libuv

What's supported

  • TCP

  • UDP

  • TTY

  • Pipe

  • Timer

  • Prepare

  • Check

  • Idle

  • Async

  • Errors


  • Port rest of libuv - ares, getaddrinfo, process, work queue, fs with events, mutexes and locks

  • Tests tests tests

  • Docs docs docs

Something went wrong with that request. Please try again.