igrigorik/em-synchrony — pull request #161 by alexkwolfe (2013-06-12 17:34:13+00:00)
Title: em-hiredis needs the #client method in order to be used in place of redis-rb

I ran into this problem when trying to use em-hiredis with em-resque. Resque expects to be able to call `redis.client.reconnect`.

But em-hiredis does not respond to `#client` [like redis-rb does](https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L10). So this pull request adds the `#client` method.

When I forked the em-synchrony repo, the hiredis spec was broken in two places, which I also fixed:

* It was raising a "NoMethodError: undefined method 'each' for nil:NilClass" on line 51. This was because `@subs` is nil. I added a simple nil check to that line and the next to avoid this error.
* It was raising "NameError: uninitialized constant EventMachine::Hiredis::Client::PUBSUB_MESSAGES" on line 67. Using the fully qualified name of that constant avoids this error.