redis_ha 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,8 @@ class RedisHA::Connection < Socket
16
16
  def yield_connect
17
17
  if @redis[:db] && !@db_selected
18
18
  @db_selected = true
19
- self << RedisHA::Protocol.request("select", @redis[:db])
19
+ @response_offset += 1
20
+ self << RedisHA::Protocol.request("select", @redis[:db])
20
21
  end
21
22
 
22
23
  connect_nonblock(@__addr)
@@ -48,14 +49,12 @@ class RedisHA::Connection < Socket
48
49
  end
49
50
 
50
51
  def <<(buf)
51
- @response_offset += 1
52
52
  @write_buffer << buf
53
53
  end
54
54
 
55
55
  def rewind
56
- @read_buffer = ""
57
56
  @ready = false
58
- @response_offset = 0
57
+ @response_offset -= 0
59
58
  end
60
59
 
61
60
  def next
@@ -8,7 +8,7 @@ class RedisHA::ConnectionPool
8
8
  # the default is 5s
9
9
  DEFAULT_RETRY_TIMEOUT = 5
10
10
 
11
- attr_accessor :status, :connections, :read_timeout, :retry_timeout
11
+ attr_accessor :connections, :read_timeout, :retry_timeout
12
12
 
13
13
  def initialize
14
14
  @read_timeout = DEFAULT_READ_TIMEOUT
@@ -15,7 +15,7 @@ require "redis_ha"
15
15
 
16
16
  pool = RedisHA::ConnectionPool.new
17
17
  pool.retry_timeout = 0.5
18
- pool.read_timeout = 10.1
18
+ pool.read_timeout = 0.1
19
19
  pool.connect(
20
20
  {:host => "localhost", :port => 6379, :db => 2},
21
21
  {:host => "127.0.0.1", :port => 6380, :db => 2})
@@ -28,7 +28,7 @@ pool.connect(
28
28
  #puts pool.smembers("fnordset").inspect
29
29
  #puts set.get.inspect
30
30
 
31
- puts pool.ping.inspect
31
+ 10.times{ puts pool.ping.inspect }
32
32
  exit
33
33
 
34
34
  Ripl.start :binding => binding
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "redis_ha"
6
- s.version = "0.1.3"
6
+ s.version = "0.1.4"
7
7
  s.date = Date.today.to_s
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Paul Asmuth"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_ha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-12-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
16
- requirement: &21888020 !ruby/object:Gem::Requirement
16
+ requirement: &20066220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *21888020
24
+ version_requirements: *20066220
25
25
  description: Three basic CRDTs (set, hashmap and counter) for redis. Also includes
26
26
  a ConnectionPool that allows you to run concurrent redis commands on multiple connections
27
27
  w/o using eventmachine/em-hiredis.