“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
While it can’t provide you the full benefits of Erlang’s immutable state
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
for a number of tasks which are presently somewhat difficult to do in
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/) and the
Concurrency Library (http://rubyforge.org/projects/concurrent/), both
authored by MenTaLguY. The syntax of these implementations and Revactor
mostly equivalent, however semantics of these three APIs are only
similar and some work will be involved in porting code between them.
Revactor 0.1.5 is a maintenance release to provide compatibility with
0.3.x, a library it uses for event monitoring. However, it also
Revactor::HttpFetcher provides a concurrent HTTP fetcher library useful
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
among as many fibers as you wish, and allows you to continuously add
the fetch queue as they enter the system. You can view the
implementation/unprocessed RDoc here:
In production, a single process on a 2.0GHz machine was able to pull
around 10Mbps worth of documents. YMMV, but I would be interested to
how it performs for other people.
Also, check out Rainbows, which uses Revactor and adds async support to
Unicorn HTTP server, and provides something like the Python Tornado HTTP
server (http://www.tornadoweb.org/) in Ruby:
Revactor Philosophy: http://revactor.org/philosophy