thrift_client 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Rakefile +1 -1
- data/lib/thrift_client/abstract_thrift_client.rb +3 -0
- data/lib/thrift_client.rb +1 -0
- data/thrift_client.gemspec +5 -5
- metadata +8 -8
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ Echoe.new("thrift_client") do |p|
|
|
7
7
|
p.project = "fauna"
|
8
8
|
p.summary = "A Thrift client wrapper that encapsulates some common failover behavior."
|
9
9
|
p.rubygems_version = ">= 0.8"
|
10
|
-
p.dependencies = ['thrift ~>0.
|
10
|
+
p.dependencies = ['thrift ~>0.7.0']
|
11
11
|
p.ignore_pattern = /^(vendor\/thrift)/
|
12
12
|
p.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
|
13
13
|
p.spec_pattern = "spec/*_spec.rb"
|
@@ -33,6 +33,7 @@ class AbstractThriftClient
|
|
33
33
|
:raise => true,
|
34
34
|
:defaults => {},
|
35
35
|
:exception_classes => DISCONNECT_ERRORS,
|
36
|
+
:exception_class_overrides => [],
|
36
37
|
:retries => 0,
|
37
38
|
:server_retry_period => 1,
|
38
39
|
:server_max_requests => nil,
|
@@ -128,6 +129,8 @@ class AbstractThriftClient
|
|
128
129
|
end
|
129
130
|
@request_count += 1
|
130
131
|
@client.send(method_name, *args)
|
132
|
+
rescue *@options[:exception_class_overrides] => e
|
133
|
+
raise_or_default(e, method_name)
|
131
134
|
rescue *@options[:exception_classes] => e
|
132
135
|
disconnect_on_error!
|
133
136
|
tries ||= (@options[:retry_overrides][method_name.to_sym] || @options[:retries]) + 1
|
data/lib/thrift_client.rb
CHANGED
@@ -16,6 +16,7 @@ Valid optional parameters are:
|
|
16
16
|
<tt>:transport</tt>:: Which Thrift transport to use. Defaults to <tt>Thrift::Socket</tt>.
|
17
17
|
<tt>:transport_wrapper</tt>:: Which Thrift transport wrapper to use. Defaults to <tt>Thrift::FramedTransport</tt>.
|
18
18
|
<tt>:exception_classes</tt>:: Which exceptions to catch and retry when sending a request. Defaults to <tt>[IOError, Thrift::Exception, Thrift::ApplicationException, Thrift::TransportException, NoServersAvailable]</tt>
|
19
|
+
<tt>:exception_class_overrides</tt>:: For specifying children of classes in exception_classes for which you don't want to retry or reconnect.
|
19
20
|
<tt>:raise</tt>:: Whether to reraise errors if no responsive servers are found. Defaults to <tt>true</tt>.
|
20
21
|
<tt>:retries</tt>:: How many times to retry a request. Defaults to 0.
|
21
22
|
<tt>:server_retry_period</tt>:: How many seconds to wait before trying to reconnect to a dead server. Defaults to <tt>1</tt>. Set to <tt>nil</tt> to disable.
|
data/thrift_client.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{thrift_client}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.7.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0.8") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [%q{Evan Weaver, Ryan King, Jeff Hodges}]
|
9
|
-
s.date = %q{2011-
|
9
|
+
s.date = %q{2011-08-22}
|
10
10
|
s.description = %q{A Thrift client wrapper that encapsulates some common failover behavior.}
|
11
11
|
s.email = %q{}
|
12
12
|
s.extra_rdoc_files = [%q{CHANGELOG}, %q{LICENSE}, %q{README.rdoc}, %q{lib/thrift_client.rb}, %q{lib/thrift_client/abstract_thrift_client.rb}, %q{lib/thrift_client/connection.rb}, %q{lib/thrift_client/connection/base.rb}, %q{lib/thrift_client/connection/factory.rb}, %q{lib/thrift_client/connection/http.rb}, %q{lib/thrift_client/connection/socket.rb}, %q{lib/thrift_client/event_machine.rb}, %q{lib/thrift_client/simple.rb}, %q{lib/thrift_client/thrift.rb}]
|
@@ -23,11 +23,11 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.specification_version = 3
|
24
24
|
|
25
25
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
-
s.add_runtime_dependency(%q<thrift>, ["~> 0.
|
26
|
+
s.add_runtime_dependency(%q<thrift>, ["~> 0.7.0"])
|
27
27
|
else
|
28
|
-
s.add_dependency(%q<thrift>, ["~> 0.
|
28
|
+
s.add_dependency(%q<thrift>, ["~> 0.7.0"])
|
29
29
|
end
|
30
30
|
else
|
31
|
-
s.add_dependency(%q<thrift>, ["~> 0.
|
31
|
+
s.add_dependency(%q<thrift>, ["~> 0.7.0"])
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thrift_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 0.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Evan Weaver, Ryan King, Jeff Hodges
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-22 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: thrift
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 3
|
29
29
|
segments:
|
30
30
|
- 0
|
31
|
-
-
|
31
|
+
- 7
|
32
32
|
- 0
|
33
|
-
version: 0.
|
33
|
+
version: 0.7.0
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
description: A Thrift client wrapper that encapsulates some common failover behavior.
|