upfluence-thrift 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thrift/client.rb +26 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0585c5dcf84ea7d019dfe7391d031ad89b8f51ed
|
4
|
+
data.tar.gz: 3569d6e14d9d6e2eac720b4569398c9e7b9ae537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c580dc31d5b3c8f31befb3baef6e3bc4e285698de536c35714f3a5c21d7f0b13bf42976f85945f0bd792381f6626ef2830d8c24fac9b5eeee1d509e14918704
|
7
|
+
data.tar.gz: f4a193a77d42cd34efc2366dda0a70c1da5fb4d24433fe70fc0f38c39ef4679e432a99fbc6319dd609bd1228cd48554061975d68f1c4ffaba391817a4d1ce8ee
|
data/lib/thrift/client.rb
CHANGED
@@ -26,11 +26,13 @@ module Thrift
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def send_message(name, args_class, args = {})
|
29
|
+
@seqid += 1
|
29
30
|
@oprot.write_message_begin(name, MessageTypes::CALL, @seqid)
|
30
31
|
send_message_args(args_class, args)
|
31
32
|
end
|
32
33
|
|
33
34
|
def send_oneway_message(name, args_class, args = {})
|
35
|
+
@seqid += 1
|
34
36
|
@oprot.write_message_begin(name, MessageTypes::ONEWAY, @seqid)
|
35
37
|
send_message_args(args_class, args)
|
36
38
|
end
|
@@ -50,9 +52,25 @@ module Thrift
|
|
50
52
|
@oprot.trans.flush
|
51
53
|
end
|
52
54
|
|
53
|
-
def receive_message(result_klass)
|
54
|
-
fname, mtype,
|
55
|
+
def receive_message(result_klass, name=nil)
|
56
|
+
fname, mtype, seqid = @iprot.read_message_begin
|
55
57
|
handle_exception(mtype)
|
58
|
+
|
59
|
+
raise ApplicationException.new(
|
60
|
+
ApplicationException::BAD_SEQUENCE_ID,
|
61
|
+
'out of seq'
|
62
|
+
) if seqid != @seqid
|
63
|
+
|
64
|
+
raise ApplicationException.new(
|
65
|
+
ApplicationException::INVALID_MESSAGE_TYPE,
|
66
|
+
'invalid message type'
|
67
|
+
) if mtype != MessageTypes::REPLY
|
68
|
+
|
69
|
+
raise ApplicationException.new(
|
70
|
+
ApplicationException::WRONG_METHOD_NAME,
|
71
|
+
'wrong method name'
|
72
|
+
) if !name.nil? && name != fname
|
73
|
+
|
56
74
|
result = result_klass.new
|
57
75
|
result.read(@iprot)
|
58
76
|
@iprot.read_message_end
|
@@ -60,12 +78,12 @@ module Thrift
|
|
60
78
|
end
|
61
79
|
|
62
80
|
def handle_exception(mtype)
|
63
|
-
if mtype
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
81
|
+
return if mtype != MessageTypes::EXCEPTION
|
82
|
+
|
83
|
+
x = ApplicationException.new
|
84
|
+
x.read(@iprot)
|
85
|
+
@iprot.read_message_end
|
86
|
+
raise x
|
69
87
|
end
|
70
88
|
end
|
71
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upfluence-thrift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thrift Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|