# Revactor 0.1.5: Erlangy add-ons to Ruby 1.9

**URL:** <https://www.ruby-forum.com/t/revactor-0-1-5-erlangy-add-ons-to-ruby-1-9/177951>\
**Category:** Ruby\
**Created:** [October 27, 2009, 6:01am UTC](https://www.ruby-forum.com/t/revactor-0-1-5-erlangy-add-ons-to-ruby-1-9/177951 "2009-10-27T06:01:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [October 27, 2009, 6:01am UTC](https://www.ruby-forum.com/t/revactor-0-1-5-erlangy-add-ons-to-ruby-1-9/177951/1 "2009-10-27T06:01:33Z")

</div>

_“The reports of my death are greatly exaggerated”_

Revactor implements an approach to concurrency known as the Actor model.  
Actors are lightweight concurrency primitives which talk to each other  
using  
messages.

While it can’t provide you the full benefits of Erlang’s immutable state  
and  
excellent performance, Revactor can provide an easier way of modeling  
complex I/O problems in Ruby that might be difficult to think about when  
forced into the inversion of control model used by standard asynchronous  
event frameworks, such as EventMachine or Rev.

Revactor uses the Ruby 1.9 Fibers mechanism to provide (relatively) high  
performance userspace concurrency for I/O bound tasks. This makes it  
useful  
for a number of tasks which are presently somewhat difficult to do in  
Ruby,  
such as web spidering and asynchronous web frameworks.

Revactor’s actor API is loosely shared with two other Ruby projects: the  
Rubinius virtual machine’s actor library ([http://rubini.us/](http://rubini.us/)) and the  
Omnibus  
Concurrency Library ([http://rubyforge.org/projects/concurrent/](http://rubyforge.org/projects/concurrent/)), both  
authored by MenTaLguY. The syntax of these implementations and Revactor  
are  
mostly equivalent, however semantics of these three APIs are only  
loosely  
similar and some work will be involved in porting code between them.

–

Revactor 0.1.5 is a maintenance release to provide compatibility with  
Rev  
0.3.x, a library it uses for event monitoring. However, it also  
includes a  
new feature:

Revactor::HttpFetcher provides a concurrent HTTP fetcher library useful  
for  
tasks like web spidering, or pretty much any situation where you need to  
fetch a lot of documents over HTTP and might discover new URLs along the  
way. This fetcher uses a scatter/gather approach to spreading a fetch  
queue  
among as many fibers as you wish, and allows you to continuously add  
URLs to  
the fetch queue as they enter the system. You can view the  
implementation/unprocessed RDoc here:

> <https://github.com/tarcieri/revactor/blob/master/lib/revactor/http_fetcher.rb>

In production, a single process on a 2.0GHz machine was able to pull  
down  
around 10Mbps worth of documents. YMMV, but I would be interested to  
hear  
how it performs for other people.

Also, check out Rainbows, which uses Revactor and adds async support to  
the  
Unicorn HTTP server, and provides something like the Python Tornado HTTP  
server ([http://www.tornadoweb.org/](http://www.tornadoweb.org/)) in Ruby:

[http://rainbows.rubyforge.org/](http://rainbows.rubyforge.org/)

–

Revactor Philosophy: [http://revactor.org/philosophy](http://revactor.org/philosophy)  
Github: [GitHub - tarcieri/revactor: Revactor implements the Actor model using Ruby 1.9's Fibers for concurrency and Rev for event monitoring](http://github.com/tarcieri/revactor)  
Gemcutter: [RubyGems.org | your community gem host](http://gemcutter.org/gems/revactor)  
Rubyforge: [http://rubyforge.org/projects/revactor/](http://rubyforge.org/projects/revactor/)
