Project

clingfilm

0.0
No commit activity in last 3 years
No release in over 3 years
A light and easy way of working concurrently with Ruby, built on top of Celluloid
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 10

Runtime

>= 0.14.0, ~> 0.14
 Project Readme

Clingfilm

A nice place for your Ruby actors to live

Clingfilm is a light system for adding concurrency to Ruby projects, built with the wonderful Celluloid project. Its goal is to be a quick & simple way to make use of the actor concurrency pattern in Ruby.

NOTE This gem is no longer actively maintained as much better solutions for concurrency in Ruby have rendered this redundant.

Why not take a look at some of these gems as an excellent way of solving similar problems?

Installation

  • Install the gem or add gem "clingfilm" to your Gemfile

Usage

Clingfilm is made up of 3 main components: MessageWrappers, Pulses and Marshallers.

Message Wrappers

Message wrappers wrap any Ruby object which has an update method and turns it into an actor. They are subcribed to one or many incomming queues and can be subscribed to multiple outgoing queues.

The wrapper listens for messages on the incoming queues. Arriving messages trigger the update method on the wrapped object.

Data returned by update is placed on any configured outgoing queues. If the result of update is nil then nothing is announced on any queues.

Pulses

Pulses are very basic actors which 'pulse' :update messages on a given interval. Useful (if slightly inaccurate) clocks for getting things going!

Marshallers

Marshallers deal with the construction and wiring up of the other elements. They also recreate any actors which die (or heroically explode!) due to uncaught exceptions.

Logging

Clingfilm publishes log messages about the sending and receiving of messages between actors at the debug level. The logging is done using Celluloid's logging mechanism, which is null unless set; for example, in Rails:

Celluloid.logger = Rails.logger

More details can be read in the Celluloid logging docs.

ToDo

  1. Add an example implementation to the documentation