em-riak 0.2.91 → 0.2.92
Sign up to get free protection for your applications and to get access to all the features.
- data/em-riak.gemspec +2 -2
- data/lib/em-riak/basic.rb +7 -4
- data/lib/em-riak/map_reduce.rb +1 -0
- data/lib/em-riak/version.rb +1 -1
- metadata +12 -12
data/em-riak.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'em-riak'
|
3
|
-
s.version = '0.2.
|
4
|
-
s.date = '2013-03-
|
3
|
+
s.version = '0.2.92'
|
4
|
+
s.date = '2013-03-09'
|
5
5
|
s.summary = "Riak client for eventmachine"
|
6
6
|
s.description = "An extremely fast and convenient riak client for eventmachine."
|
7
7
|
s.authors = ["Von"]
|
data/lib/em-riak/basic.rb
CHANGED
@@ -168,9 +168,12 @@ module EmRiak
|
|
168
168
|
|
169
169
|
data[:query]="?returnbody=true"
|
170
170
|
request_options=data.reject{|k,v| k==:retry} #request options, reject some data before submit
|
171
|
+
request_options.merge({ :connect_timeout => EM_REQUEST_TIMEOUT, :inactivity_timeout => EM_INACTIVITY_TIMEOUT, :keepalive=>true})
|
172
|
+
#:connect_timeout => EM_REQUEST_TIMEOUT, :inactivity_timeout => EM_INACTIVITY_TIMEOUT,
|
173
|
+
|
171
174
|
path_result=generate_path(url)
|
172
175
|
execute_url = path_result[:url]
|
173
|
-
host = path_result[:host]
|
176
|
+
host = path_result[:host]
|
174
177
|
|
175
178
|
# == Start
|
176
179
|
# These lines should reduce high em-http recreate cost. (especially if we create ssl conn)
|
@@ -180,16 +183,16 @@ module EmRiak
|
|
180
183
|
raise "do it later because pool full" if EmRiak.em_enqueue_pool[host][:working].count>=EmRiak.em_enqueue_pool_max
|
181
184
|
|
182
185
|
if EmRiak.em_enqueue_pool[host][:alives].count<1
|
183
|
-
enqueue=EventMachine::HttpRequest.new(execute_url,{:keepalive=>true}) # keepalive will make all connections alive, so we can avoid heavy cpu load when large amount em_http instance create
|
186
|
+
enqueue=EventMachine::HttpRequest.new(execute_url,{ :connect_timeout => EM_REQUEST_TIMEOUT, :inactivity_timeout => EM_INACTIVITY_TIMEOUT, :keepalive=>true}) # keepalive will make all connections alive, so we can avoid heavy cpu load when large amount em_http instance create
|
184
187
|
EmRiak.em_enqueue_pool[host][:working].push(enqueue)
|
185
188
|
else
|
186
189
|
enqueue=EmRiak.em_enqueue_pool[host][:alives].pop
|
187
190
|
EmRiak.em_enqueue_pool[host][:working].push(enqueue)
|
188
191
|
end
|
189
192
|
# == End
|
190
|
-
|
193
|
+
|
191
194
|
# Do job
|
192
|
-
riakHttp = enqueue.send method.to_sym , :
|
195
|
+
riakHttp = enqueue.send method.to_sym , :keepalive=>true, :head=>data[:head], :body=>data[:body], :query=>data[:query] #, request_options
|
193
196
|
riakHttp.errback{ # Error Callback
|
194
197
|
puts "#{method} - #{key} - riak callback error #{riakHttp.response}" if EmRiak.debug
|
195
198
|
data[:retry]+=1
|
data/lib/em-riak/map_reduce.rb
CHANGED
data/lib/em-riak/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-riak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.92
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: escape_utils
|
16
|
-
requirement: &
|
16
|
+
requirement: &70326827416060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70326827416060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yajl-ruby
|
27
|
-
requirement: &
|
27
|
+
requirement: &70326827415620 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70326827415620
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: httpi
|
38
|
-
requirement: &
|
38
|
+
requirement: &70326827414820 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70326827414820
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: eventmachine
|
49
|
-
requirement: &
|
49
|
+
requirement: &70326827414400 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70326827414400
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: em-http-request
|
60
|
-
requirement: &
|
60
|
+
requirement: &70326827413860 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70326827413860
|
69
69
|
description: An extremely fast and convenient riak client for eventmachine.
|
70
70
|
email: von@vonstark.co
|
71
71
|
executables: []
|