0.04
Repository is archived
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Celluloid::IO support for the redis-rb library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

>= 0.13.0.pre
>= 0
 Project Readme

Celluloid::Redis

Gem Version MIT licensed Build Status Maintained: no

A Celluloid::IO-based connection backend for the redis-rb gem, providing "evented" connection support that can multiplex long-lived blocking calls like pub/sub and blpop(rpush) with the Celluloid message protocol.

Why?

Unlike EventMachine, Celluloid::IO ideally does not need to provide separate "Celluloid-enabled" versions of each and every library that ever does any kind of I/O, but can instead leverage dependency injection APIs that tell libraries to use Celluloid::IO::TCPSocket instead of TCPSocket.

Unfortunately, the redis-rb gem is a bit gnarly and does a lot of strange things like monkeypatching its own subclasses of TCPSocket and UNIXSocket in attempts to add better timeout handling.

Rather than trying to inject itself into that mess, this gem provides Redis::Connection::Celluloid which seeks to be a drop-in replacement for Redis::Connection::Ruby.

Installation

Add this line to your application's Gemfile:

gem 'celluloid-redis'

And then execute:

$ bundle

Or install it yourself as:

$ gem install celluloid-redis

Require it in your Ruby application with:

require 'celluloid/redis'

Usage

When instantiating the client object, specify :celluloid:

redis = Redis.new(:driver => :celluloid)

Contributing

  • Fork this repository on github
  • Make your changes and send us a pull request
  • If we like them we'll merge them
  • If we've accepted a patch, feel free to ask for commit access

License

Copyright (c) 2013 Tony Arcieri. Distributed under the MIT License. See LICENSE.txt for further details.