[ANN] cool.io 1.0.0: a cool event framework for Ruby (formerly knownas Rev)

T

Tony Arcieri

[Note: parts of this message were removed to make it a legal post.]

Do you like Sinatra? Do you like Node.js? Wish you could write Node.js apps
in Ruby as easily as you write Sinatra apps? Let's ask Cool.io how:

http://coolio.github.com
https://github.com/tarcieri/cool.io

Cool.io is a framework for building event-driven applications, namely
scalable network servers and clients, but also provides out-of-the-box
support for filesystem monitoring and inter-thread signaling. Cool.io also
supports a robust event-driven HTTP/1.1 client suitable for creating web
spiders or other HTTP clients that need to make large numbers of concurrent
connections.

Cool.io is built on libev, a fast C-based event library which also provides
the underpinnings for evented I/O in Node.js. It works on Ruby 1.8.7+,
1.9.2+, and Rubinius HEAD.

Cool.io 1.0.0 features a cool new DSL which makes writing evented network
servers and clients this easy. Here's an example echo server:

require 'rubygems'
require 'cool.io'

ADDR = '127.0.0.1'
PORT = 4321

cool.io.server ADDR, PORT do
on_connect do
puts "#{remote_addr}:#{remote_port} connected"
end

on_close do
puts "#{remote_addr}:#{remote_port} disconnected"
end

on_read do |data|
write data
end
end

puts "Echo server listening on #{ADDR}:#{PORT}"
cool.io.run


For more information, see the home page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top