redis_failover 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
data/Changes.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.9.7
2
+ -----------
3
+ - Stubbed Client#client to return itself, fixes a fork reconnect bug with Resque (dbalatero)
4
+
1
5
  0.9.6
2
6
  -----------
3
7
  - Handle the node discovery error condition where the znode points to a master that is now a slave.
data/README.md CHANGED
@@ -175,6 +175,7 @@ redis_failover uses YARD for its API documentation. Refer to the generated [API
175
175
  - To learn more about ZooKeeper, see the official [ZooKeeper](http://zookeeper.apache.org/) site.
176
176
  - See the [Quick ZooKeeper Guide](https://github.com/ryanlecompte/redis_failover/wiki/Quick-ZooKeeper-Guide) for a quick guide to getting ZooKeeper up and running with redis_failover.
177
177
  - To learn more about how ZooKeeper handles network partitions, see [ZooKeeper Failure Scenarios](http://wiki.apache.org/hadoop/ZooKeeper/FailureScenarios)
178
+ - Slides for a [lightning talk](http://www.slideshare.net/ryanlecompte/handling-redis-failover-with-zookeeper) that I gave at BaRuCo 2012.
178
179
  - Feel free to join #zk-gem on the IRC freenode network. We're usually hanging out there talking about ZooKeeper and redis_failover.
179
180
 
180
181
 
@@ -64,6 +64,21 @@ module RedisFailover
64
64
  build_clients
65
65
  end
66
66
 
67
+ # Stubs this method to return this RedisFailover::Client object.
68
+ #
69
+ # Some libraries (Resque) assume they can access the `client` via this method,
70
+ # but we don't want to actually ever expose the internal Redis connections.
71
+ #
72
+ # By returning `self` here, we can add stubs for functionality like #reconnect,
73
+ # and everything will Just Work.
74
+ #
75
+ # Takes an *args array for safety only.
76
+ #
77
+ # @return [RedisFailover::Client]
78
+ def client(*args)
79
+ self
80
+ end
81
+
67
82
  # Specifies a callback to invoke when the current redis node list changes.
68
83
  #
69
84
  # @param [Proc] a callback with current master and slaves as arguments
@@ -1,3 +1,3 @@
1
1
  module RedisFailover
2
- VERSION = '0.9.6'
2
+ VERSION = '0.9.7'
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -38,6 +38,12 @@ module RedisFailover
38
38
  end
39
39
  end
40
40
 
41
+ describe '#client' do
42
+ it 'should return itself as a delegate' do
43
+ client.client.should == client
44
+ end
45
+ end
46
+
41
47
  describe '#dispatch' do
42
48
  it 'routes write operations to master' do
43
49
  called = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_failover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-01 00:00:00.000000000 Z
12
+ date: 2012-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -189,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  segments:
191
191
  - 0
192
- hash: -1728937543756206393
192
+ hash: 2274017525429057162
193
193
  required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements:
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  version: '0'
199
199
  segments:
200
200
  - 0
201
- hash: -1728937543756206393
201
+ hash: 2274017525429057162
202
202
  requirements: []
203
203
  rubyforge_project:
204
204
  rubygems_version: 1.8.23