Celluloid provides a simple and natural way to build fault-tolerant concurrent programs in Ruby. With Celluloid, you can build systems out of concurrent objects just as easily as you build sequential programs out of regular objects.

Much of the difficulty with building concurrent programs in Ruby arises because the object-oriented mechanisms for structuring code, such as classes and inheritance, are separate from the concurrency mechanisms, such as threads and locks. Celluloid combines these into a single structure, an active object running within a thread, called an "actor", or in Celluloid vernacular, a "cell".

The Actor Model can be summarized as follows:

  1. Actors communicate by sending messages
  2. Every actor has a mailbox with a unique address.
  3. If you have an actor's address, you can send it messages
  4. Actors can create other actors, and when they do they know their address so they can send the newly-created actors messages
  5. Actors can pass addresses (or handles) to themselves or other actors in messages

Casiano Rodriguez León 2015-06-18