Polyphony - Easy Concurrency for Ruby

DOCS | EXAMPLES

Polyphony | pəˈlɪf(ə)ni | Music - the style of simultaneously combining a number of parts, each forming an individual melody and harmonizing with each other.

What is Polyphony

Polyphony is a library for building concurrent applications in Ruby. Polyphony harnesses the power of Ruby fibers to provide a cooperative, sequential coprocess-based concurrency model. Under the hood, Polyphony uses libev as a high-performance event reactor that provides timers, I/O watchers and other asynchronous event primitives.

Polyphony makes it possible to use normal Ruby built-in classes like IO, and Socket in a concurrent fashion without having to resort to threads. Polyphony takes care of context-switching automatically whenever a blocking call like Socket#accept or IO#read is issued.

Features

Prior Art

Polyphony draws inspiration from the following, in no particular order:

Documentation

The complete documentation for Polyphony could be found on the Polyphony website.