astro-remcached 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :major: 0
4
4
  :minor: 2
@@ -24,14 +24,6 @@ module Memcached
24
24
  @connect_deferrable
25
25
  end
26
26
 
27
- def close
28
- close_connection
29
- @connected = false
30
- @pending.each do |opaque, callback|
31
- callback.call :status => Errors::DISCONNECTED
32
- end
33
- end
34
-
35
27
  def post_init
36
28
  @recv_buf = ""
37
29
  @recv_state = :header
@@ -46,7 +38,7 @@ module Memcached
46
38
  RECONNECT_DELAY = 10
47
39
  RECONNECT_JITTER = 5
48
40
  def unbind
49
- close
41
+ @connected = false
50
42
  EventMachine::Timer.new(RECONNECT_DELAY + rand(RECONNECT_JITTER),
51
43
  method(:reconnect))
52
44
  end
@@ -86,6 +78,14 @@ module Memcached
86
78
  @pending = []
87
79
  end
88
80
 
81
+ def unbind
82
+ super
83
+ @pending.each do |opaque, callback|
84
+ callback.call :status => Errors::DISCONNECTED
85
+ end
86
+ @pending = []
87
+ end
88
+
89
89
  def send_request(pkt, &callback)
90
90
  @opaque_counter += 1
91
91
  @opaque_counter %= 1 << 32
data/lib/remcached.rb CHANGED
@@ -5,12 +5,15 @@ require 'remcached/client'
5
5
  module Memcached
6
6
  class << self
7
7
  ##
8
- # +servers+: either Array of host:port strings or Hash of
9
- # host:port => weight integers
8
+ # +servers+: Array of host:port strings
10
9
  def servers=(servers)
11
10
  if defined?(@clients) && @clients
12
11
  while client = @clients.shift
13
- client.close
12
+ begin
13
+ client.close
14
+ rescue Exception
15
+ # This is allowed to fail silently
16
+ end
14
17
  end
15
18
  end
16
19
 
data/remcached.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{remcached}
5
- s.version = "0.2.1"
6
-
5
+ s.version = "0.2.2"
6
+
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Stephan Maka"]
9
- s.date = %q{2009-09-11}
9
+ s.date = %q{2009-09-12}
10
10
  s.description = %q{Ruby EventMachine memcached client}
11
11
  s.email = %q{astro@spaceboyz.net}
12
12
  s.files = [
data/spec/client_spec.rb CHANGED
@@ -9,6 +9,7 @@ describe Memcached::Client do
9
9
  end
10
10
  end
11
11
  def stop
12
+ @cl.close_connection
12
13
  EM.stop
13
14
  end
14
15
 
@@ -17,6 +17,7 @@ describe Memcached::Client do
17
17
  end
18
18
  end
19
19
  def stop
20
+ Memcached.servers = []
20
21
  EM.stop
21
22
  end
22
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: astro-remcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Maka
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-11 00:00:00 -07:00
12
+ date: 2009-09-12 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -36,6 +36,7 @@ files:
36
36
  - spec/packet_spec.rb
37
37
  has_rdoc: false
38
38
  homepage: http://github.com/astro/remcached/
39
+ licenses:
39
40
  post_install_message:
40
41
  rdoc_options:
41
42
  - --charset=UTF-8
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  requirements: []
57
58
 
58
59
  rubyforge_project:
59
- rubygems_version: 1.2.0
60
+ rubygems_version: 1.3.5
60
61
  signing_key:
61
62
  specification_version: 3
62
63
  summary: Ruby EventMachine memcached client