upfluence-thrift 1.0.12 → 1.1.0

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.
Files changed (33) hide show
  1. checksums.yaml +5 -5
  2. data/benchmark/gen-rb/benchmark_constants.rb +1 -1
  3. data/benchmark/gen-rb/benchmark_service.rb +21 -10
  4. data/benchmark/gen-rb/benchmark_types.rb +1 -1
  5. data/lib/thrift/server/rack_application.rb +30 -19
  6. data/spec/gen-rb/base/base_service.rb +21 -10
  7. data/spec/gen-rb/base/base_service_constants.rb +1 -1
  8. data/spec/gen-rb/base/base_service_types.rb +1 -1
  9. data/spec/gen-rb/extended/extended_service.rb +21 -10
  10. data/spec/gen-rb/extended/extended_service_constants.rb +1 -1
  11. data/spec/gen-rb/extended/extended_service_types.rb +1 -1
  12. data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +67 -40
  13. data/spec/gen-rb/flat/referenced_constants.rb +1 -1
  14. data/spec/gen-rb/flat/referenced_types.rb +1 -1
  15. data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +1 -1
  16. data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +1 -1
  17. data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +67 -40
  18. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +1 -1
  19. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +1 -1
  20. data/spec/gen-rb/nonblocking_service.rb +67 -40
  21. data/spec/gen-rb/other_namespace/referenced_constants.rb +1 -1
  22. data/spec/gen-rb/other_namespace/referenced_types.rb +1 -1
  23. data/spec/gen-rb/thrift_spec_constants.rb +1 -1
  24. data/spec/gen-rb/thrift_spec_types.rb +1 -1
  25. data/spec/rack_application_spec.rb +1 -1
  26. data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +44 -44
  27. data/test/debug_proto/gen-rb/debug_proto_test_types.rb +1 -1
  28. data/test/debug_proto/gen-rb/empty_service.rb +8 -1
  29. data/test/debug_proto/gen-rb/inherited.rb +21 -10
  30. data/test/debug_proto/gen-rb/reverse_order_service.rb +21 -10
  31. data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +24 -13
  32. data/test/debug_proto/gen-rb/srv.rb +83 -52
  33. metadata +11 -12
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
2
+ # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
2
+ # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -8,9 +8,16 @@ require 'thrift'
8
8
  require 'debug_proto_test_types'
9
9
 
10
10
  module EmptyService
11
+ SERVICE_NAME = "EmptyService"
12
+ PROGRAM_NAME = ""
13
+
11
14
  class Client
12
15
  include ::Thrift::Client
13
16
 
17
+ def self.from_provider(provider)
18
+ Client.new(*provider.build(", EmptyService"))
19
+ end
20
+
14
21
  end
15
22
 
16
23
  class Processor
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
2
+ # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -9,19 +9,28 @@ require 'srv'
9
9
  require 'debug_proto_test_types'
10
10
 
11
11
  module Inherited
12
+ SERVICE_NAME = "Inherited"
13
+ PROGRAM_NAME = ""
14
+
12
15
  class Client < ::Srv::Client
13
16
  include ::Thrift::Client
14
17
 
15
- def identity(arg)
16
- send_identity(arg)
17
- return recv_identity()
18
+ def self.from_provider(provider)
19
+ Client.new(*provider.build(", Inherited"))
20
+ end
21
+
22
+ def identity(ctx, arg)
23
+ @middleware.handle_binary(ctx, 'identity', Identity_args.new(:arg => arg)) do |ctx, args|
24
+ send_identity(ctx, args.arg)
25
+ return recv_identity(ctx)
26
+ end
18
27
  end
19
28
 
20
- def send_identity(arg)
29
+ def send_identity(ctx, arg)
21
30
  send_message('identity', Identity_args, :arg => arg)
22
31
  end
23
32
 
24
- def recv_identity()
33
+ def recv_identity(ctx)
25
34
  result = receive_message(Identity_result)
26
35
  return result.success unless result.success.nil?
27
36
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result')
@@ -32,11 +41,13 @@ module Inherited
32
41
  class Processor < ::Srv::Processor
33
42
  include ::Thrift::Processor
34
43
 
35
- def process_identity(seqid, iprot, oprot)
44
+ def process_identity(ctx, seqid, iprot, oprot)
36
45
  args = read_args(iprot, Identity_args)
37
- result = Identity_result.new()
38
- result.success = @handler.identity(args.arg)
39
- write_result(result, oprot, 'identity', seqid)
46
+ @middleware.handle_binary(ctx, 'identity', args) do |ctx, args|
47
+ result = Identity_result.new()
48
+ result.success = @handler.identity(ctx, args.arg)
49
+ write_result(result, oprot, 'identity', seqid)
50
+ end
40
51
  end
41
52
 
42
53
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
2
+ # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -8,19 +8,28 @@ require 'thrift'
8
8
  require 'debug_proto_test_types'
9
9
 
10
10
  module ReverseOrderService
11
+ SERVICE_NAME = "ReverseOrderService"
12
+ PROGRAM_NAME = ""
13
+
11
14
  class Client
12
15
  include ::Thrift::Client
13
16
 
14
- def myMethod(first, second, third, fourth)
15
- send_myMethod(first, second, third, fourth)
16
- recv_myMethod()
17
+ def self.from_provider(provider)
18
+ Client.new(*provider.build(", ReverseOrderService"))
19
+ end
20
+
21
+ def myMethod(ctx, first, second, third, fourth)
22
+ @middleware.handle_binary(ctx, 'myMethod', MyMethod_args.new(:first => first, :second => second, :third => third, :fourth => fourth)) do |ctx, args|
23
+ send_myMethod(ctx, args.first, args.second, args.third, args.fourth)
24
+ recv_myMethod(ctx)
25
+ end
17
26
  end
18
27
 
19
- def send_myMethod(first, second, third, fourth)
28
+ def send_myMethod(ctx, first, second, third, fourth)
20
29
  send_message('myMethod', MyMethod_args, :first => first, :second => second, :third => third, :fourth => fourth)
21
30
  end
22
31
 
23
- def recv_myMethod()
32
+ def recv_myMethod(ctx)
24
33
  result = receive_message(MyMethod_result)
25
34
  return
26
35
  end
@@ -30,11 +39,13 @@ module ReverseOrderService
30
39
  class Processor
31
40
  include ::Thrift::Processor
32
41
 
33
- def process_myMethod(seqid, iprot, oprot)
42
+ def process_myMethod(ctx, seqid, iprot, oprot)
34
43
  args = read_args(iprot, MyMethod_args)
35
- result = MyMethod_result.new()
36
- @handler.myMethod(args.first, args.second, args.third, args.fourth)
37
- write_result(result, oprot, 'myMethod', seqid)
44
+ @middleware.handle_binary(ctx, 'myMethod', args) do |ctx, args|
45
+ result = MyMethod_result.new()
46
+ @handler.myMethod(ctx, args.first, args.second, args.third, args.fourth)
47
+ write_result(result, oprot, 'myMethod', seqid)
48
+ end
38
49
  end
39
50
 
40
51
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
2
+ # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -8,19 +8,28 @@ require 'thrift'
8
8
  require 'debug_proto_test_types'
9
9
 
10
10
  module ServiceForExceptionWithAMap
11
+ SERVICE_NAME = "ServiceForExceptionWithAMap"
12
+ PROGRAM_NAME = ""
13
+
11
14
  class Client
12
15
  include ::Thrift::Client
13
16
 
14
- def methodThatThrowsAnException()
15
- send_methodThatThrowsAnException()
16
- recv_methodThatThrowsAnException()
17
+ def self.from_provider(provider)
18
+ Client.new(*provider.build(", ServiceForExceptionWithAMap"))
19
+ end
20
+
21
+ def methodThatThrowsAnException(ctx)
22
+ @middleware.handle_binary(ctx, 'methodThatThrowsAnException', MethodThatThrowsAnException_args.new()) do |ctx, args|
23
+ send_methodThatThrowsAnException(ctx, )
24
+ recv_methodThatThrowsAnException(ctx)
25
+ end
17
26
  end
18
27
 
19
- def send_methodThatThrowsAnException()
28
+ def send_methodThatThrowsAnException(ctx)
20
29
  send_message('methodThatThrowsAnException', MethodThatThrowsAnException_args)
21
30
  end
22
31
 
23
- def recv_methodThatThrowsAnException()
32
+ def recv_methodThatThrowsAnException(ctx)
24
33
  result = receive_message(MethodThatThrowsAnException_result)
25
34
  raise result.xwamap unless result.xwamap.nil?
26
35
  return
@@ -31,15 +40,17 @@ module ServiceForExceptionWithAMap
31
40
  class Processor
32
41
  include ::Thrift::Processor
33
42
 
34
- def process_methodThatThrowsAnException(seqid, iprot, oprot)
43
+ def process_methodThatThrowsAnException(ctx, seqid, iprot, oprot)
35
44
  args = read_args(iprot, MethodThatThrowsAnException_args)
36
- result = MethodThatThrowsAnException_result.new()
37
- begin
38
- @handler.methodThatThrowsAnException()
39
- rescue ::ExceptionWithAMap => xwamap
40
- result.xwamap = xwamap
45
+ @middleware.handle_binary(ctx, 'methodThatThrowsAnException', args) do |ctx, args|
46
+ result = MethodThatThrowsAnException_result.new()
47
+ begin
48
+ @handler.methodThatThrowsAnException(ctx, )
49
+ rescue ::ExceptionWithAMap => xwamap
50
+ result.xwamap = xwamap
51
+ end
52
+ write_result(result, oprot, 'methodThatThrowsAnException', seqid)
41
53
  end
42
- write_result(result, oprot, 'methodThatThrowsAnException', seqid)
43
54
  end
44
55
 
45
56
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler (1.0.0-upfluence)
2
+ # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -8,87 +8,106 @@ require 'thrift'
8
8
  require 'debug_proto_test_types'
9
9
 
10
10
  module Srv
11
+ SERVICE_NAME = "Srv"
12
+ PROGRAM_NAME = ""
13
+
11
14
  class Client
12
15
  include ::Thrift::Client
13
16
 
14
- def Janky(arg)
15
- send_Janky(arg)
16
- return recv_Janky()
17
+ def self.from_provider(provider)
18
+ Client.new(*provider.build(", Srv"))
19
+ end
20
+
21
+ def Janky(ctx, arg)
22
+ @middleware.handle_binary(ctx, 'Janky', Janky_args.new(:arg => arg)) do |ctx, args|
23
+ send_Janky(ctx, args.arg)
24
+ return recv_Janky(ctx)
25
+ end
17
26
  end
18
27
 
19
- def send_Janky(arg)
28
+ def send_Janky(ctx, arg)
20
29
  send_message('Janky', Janky_args, :arg => arg)
21
30
  end
22
31
 
23
- def recv_Janky()
32
+ def recv_Janky(ctx)
24
33
  result = receive_message(Janky_result)
25
34
  return result.success unless result.success.nil?
26
35
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'Janky failed: unknown result')
27
36
  end
28
37
 
29
- def voidMethod()
30
- send_voidMethod()
31
- recv_voidMethod()
38
+ def voidMethod(ctx)
39
+ @middleware.handle_binary(ctx, 'voidMethod', VoidMethod_args.new()) do |ctx, args|
40
+ send_voidMethod(ctx, )
41
+ recv_voidMethod(ctx)
42
+ end
32
43
  end
33
44
 
34
- def send_voidMethod()
45
+ def send_voidMethod(ctx)
35
46
  send_message('voidMethod', VoidMethod_args)
36
47
  end
37
48
 
38
- def recv_voidMethod()
49
+ def recv_voidMethod(ctx)
39
50
  result = receive_message(VoidMethod_result)
40
51
  return
41
52
  end
42
53
 
43
- def primitiveMethod()
44
- send_primitiveMethod()
45
- return recv_primitiveMethod()
54
+ def primitiveMethod(ctx)
55
+ @middleware.handle_binary(ctx, 'primitiveMethod', PrimitiveMethod_args.new()) do |ctx, args|
56
+ send_primitiveMethod(ctx, )
57
+ return recv_primitiveMethod(ctx)
58
+ end
46
59
  end
47
60
 
48
- def send_primitiveMethod()
61
+ def send_primitiveMethod(ctx)
49
62
  send_message('primitiveMethod', PrimitiveMethod_args)
50
63
  end
51
64
 
52
- def recv_primitiveMethod()
65
+ def recv_primitiveMethod(ctx)
53
66
  result = receive_message(PrimitiveMethod_result)
54
67
  return result.success unless result.success.nil?
55
68
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'primitiveMethod failed: unknown result')
56
69
  end
57
70
 
58
- def structMethod()
59
- send_structMethod()
60
- return recv_structMethod()
71
+ def structMethod(ctx)
72
+ @middleware.handle_binary(ctx, 'structMethod', StructMethod_args.new()) do |ctx, args|
73
+ send_structMethod(ctx, )
74
+ return recv_structMethod(ctx)
75
+ end
61
76
  end
62
77
 
63
- def send_structMethod()
78
+ def send_structMethod(ctx)
64
79
  send_message('structMethod', StructMethod_args)
65
80
  end
66
81
 
67
- def recv_structMethod()
82
+ def recv_structMethod(ctx)
68
83
  result = receive_message(StructMethod_result)
69
84
  return result.success unless result.success.nil?
70
85
  raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'structMethod failed: unknown result')
71
86
  end
72
87
 
73
- def methodWithDefaultArgs(something)
74
- send_methodWithDefaultArgs(something)
75
- recv_methodWithDefaultArgs()
88
+ def methodWithDefaultArgs(ctx, something)
89
+ @middleware.handle_binary(ctx, 'methodWithDefaultArgs', MethodWithDefaultArgs_args.new(:something => something)) do |ctx, args|
90
+ send_methodWithDefaultArgs(ctx, args.something)
91
+ recv_methodWithDefaultArgs(ctx)
92
+ end
76
93
  end
77
94
 
78
- def send_methodWithDefaultArgs(something)
95
+ def send_methodWithDefaultArgs(ctx, something)
79
96
  send_message('methodWithDefaultArgs', MethodWithDefaultArgs_args, :something => something)
80
97
  end
81
98
 
82
- def recv_methodWithDefaultArgs()
99
+ def recv_methodWithDefaultArgs(ctx)
83
100
  result = receive_message(MethodWithDefaultArgs_result)
84
101
  return
85
102
  end
86
103
 
87
- def onewayMethod()
88
- send_onewayMethod()
104
+ def onewayMethod(ctx)
105
+ @middleware.handle_unary(ctx, 'onewayMethod', OnewayMethod_args.new()) do |ctx, args|
106
+ send_onewayMethod(ctx, )
107
+ end
89
108
  end
90
109
 
91
- def send_onewayMethod()
110
+ def send_onewayMethod(ctx)
92
111
  send_oneway_message('onewayMethod', OnewayMethod_args)
93
112
  end
94
113
  end
@@ -96,45 +115,57 @@ module Srv
96
115
  class Processor
97
116
  include ::Thrift::Processor
98
117
 
99
- def process_Janky(seqid, iprot, oprot)
118
+ def process_Janky(ctx, seqid, iprot, oprot)
100
119
  args = read_args(iprot, Janky_args)
101
- result = Janky_result.new()
102
- result.success = @handler.Janky(args.arg)
103
- write_result(result, oprot, 'Janky', seqid)
120
+ @middleware.handle_binary(ctx, 'Janky', args) do |ctx, args|
121
+ result = Janky_result.new()
122
+ result.success = @handler.Janky(ctx, args.arg)
123
+ write_result(result, oprot, 'Janky', seqid)
124
+ end
104
125
  end
105
126
 
106
- def process_voidMethod(seqid, iprot, oprot)
127
+ def process_voidMethod(ctx, seqid, iprot, oprot)
107
128
  args = read_args(iprot, VoidMethod_args)
108
- result = VoidMethod_result.new()
109
- @handler.voidMethod()
110
- write_result(result, oprot, 'voidMethod', seqid)
129
+ @middleware.handle_binary(ctx, 'voidMethod', args) do |ctx, args|
130
+ result = VoidMethod_result.new()
131
+ @handler.voidMethod(ctx, )
132
+ write_result(result, oprot, 'voidMethod', seqid)
133
+ end
111
134
  end
112
135
 
113
- def process_primitiveMethod(seqid, iprot, oprot)
136
+ def process_primitiveMethod(ctx, seqid, iprot, oprot)
114
137
  args = read_args(iprot, PrimitiveMethod_args)
115
- result = PrimitiveMethod_result.new()
116
- result.success = @handler.primitiveMethod()
117
- write_result(result, oprot, 'primitiveMethod', seqid)
138
+ @middleware.handle_binary(ctx, 'primitiveMethod', args) do |ctx, args|
139
+ result = PrimitiveMethod_result.new()
140
+ result.success = @handler.primitiveMethod(ctx, )
141
+ write_result(result, oprot, 'primitiveMethod', seqid)
142
+ end
118
143
  end
119
144
 
120
- def process_structMethod(seqid, iprot, oprot)
145
+ def process_structMethod(ctx, seqid, iprot, oprot)
121
146
  args = read_args(iprot, StructMethod_args)
122
- result = StructMethod_result.new()
123
- result.success = @handler.structMethod()
124
- write_result(result, oprot, 'structMethod', seqid)
147
+ @middleware.handle_binary(ctx, 'structMethod', args) do |ctx, args|
148
+ result = StructMethod_result.new()
149
+ result.success = @handler.structMethod(ctx, )
150
+ write_result(result, oprot, 'structMethod', seqid)
151
+ end
125
152
  end
126
153
 
127
- def process_methodWithDefaultArgs(seqid, iprot, oprot)
154
+ def process_methodWithDefaultArgs(ctx, seqid, iprot, oprot)
128
155
  args = read_args(iprot, MethodWithDefaultArgs_args)
129
- result = MethodWithDefaultArgs_result.new()
130
- @handler.methodWithDefaultArgs(args.something)
131
- write_result(result, oprot, 'methodWithDefaultArgs', seqid)
156
+ @middleware.handle_binary(ctx, 'methodWithDefaultArgs', args) do |ctx, args|
157
+ result = MethodWithDefaultArgs_result.new()
158
+ @handler.methodWithDefaultArgs(ctx, args.something)
159
+ write_result(result, oprot, 'methodWithDefaultArgs', seqid)
160
+ end
132
161
  end
133
162
 
134
- def process_onewayMethod(seqid, iprot, oprot)
163
+ def process_onewayMethod(ctx, seqid, iprot, oprot)
135
164
  args = read_args(iprot, OnewayMethod_args)
136
- @handler.onewayMethod()
137
- return
165
+ @middleware.handle_unary(ctx, 'onewayMethod', args) do |ctx, args|
166
+ @handler.onewayMethod(ctx, )
167
+ return
168
+ end
138
169
  end
139
170
 
140
171
  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.12
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thrift Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-01 00:00:00.000000000 Z
11
+ date: 2020-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -28,30 +28,30 @@ dependencies:
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.2
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.2
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.6.2
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.6.2
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thin
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -331,8 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
331
  - !ruby/object:Gem::Version
332
332
  version: '0'
333
333
  requirements: []
334
- rubyforge_project: thrift
335
- rubygems_version: 2.4.8
334
+ rubygems_version: 3.0.3
336
335
  signing_key:
337
336
  specification_version: 4
338
337
  summary: Ruby bindings for Apache Thrift