astro-remcached 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/remcached/client.rb +9 -9
- data/lib/remcached.rb +6 -3
- data/remcached.gemspec +3 -3
- data/spec/client_spec.rb +1 -0
- data/spec/memcached_spec.rb +1 -0
- metadata +4 -3
data/VERSION.yml
CHANGED
data/lib/remcached/client.rb
CHANGED
@@ -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
|
-
|
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+:
|
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
|
-
|
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.
|
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-
|
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
data/spec/memcached_spec.rb
CHANGED
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.
|
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-
|
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.
|
60
|
+
rubygems_version: 1.3.5
|
60
61
|
signing_key:
|
61
62
|
specification_version: 3
|
62
63
|
summary: Ruby EventMachine memcached client
|