upfluence-thrift 2.1.1 → 2.2.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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/thrift/client.rb +30 -9
  3. data/lib/thrift/definition.rb +45 -5
  4. data/lib/thrift/middleware.rb +13 -0
  5. data/lib/thrift/processor.rb +2 -9
  6. data/lib/thrift/struct.rb +10 -10
  7. data/lib/thrift/transport/server_socket.rb +6 -6
  8. metadata +2 -74
  9. data/benchmark/gen-rb/benchmark_constants.rb +0 -11
  10. data/benchmark/gen-rb/benchmark_service.rb +0 -91
  11. data/benchmark/gen-rb/benchmark_types.rb +0 -10
  12. data/spec/gen-rb/base/base_service.rb +0 -91
  13. data/spec/gen-rb/base/base_service_constants.rb +0 -11
  14. data/spec/gen-rb/base/base_service_types.rb +0 -26
  15. data/spec/gen-rb/extended/extended_service.rb +0 -89
  16. data/spec/gen-rb/extended/extended_service_constants.rb +0 -11
  17. data/spec/gen-rb/extended/extended_service_types.rb +0 -12
  18. data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +0 -299
  19. data/spec/gen-rb/flat/referenced_constants.rb +0 -11
  20. data/spec/gen-rb/flat/referenced_types.rb +0 -17
  21. data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +0 -11
  22. data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +0 -28
  23. data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +0 -299
  24. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +0 -11
  25. data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +0 -28
  26. data/spec/gen-rb/nonblocking_service.rb +0 -299
  27. data/spec/gen-rb/other_namespace/referenced_constants.rb +0 -11
  28. data/spec/gen-rb/other_namespace/referenced_types.rb +0 -17
  29. data/spec/gen-rb/thrift_spec_constants.rb +0 -11
  30. data/spec/gen-rb/thrift_spec_types.rb +0 -538
  31. data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +0 -274
  32. data/test/debug_proto/gen-rb/debug_proto_test_types.rb +0 -761
  33. data/test/debug_proto/gen-rb/empty_service.rb +0 -31
  34. data/test/debug_proto/gen-rb/inherited.rb +0 -90
  35. data/test/debug_proto/gen-rb/reverse_order_service.rb +0 -93
  36. data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +0 -92
  37. data/test/debug_proto/gen-rb/srv.rb +0 -361
@@ -1,31 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'debug_proto_test_types'
9
-
10
- module EmptyService
11
- SERVICE_NAME = "EmptyService"
12
- PROGRAM_NAME = ""
13
-
14
- class Client
15
- include ::Thrift::Client
16
-
17
- def self.from_provider(provider)
18
- Client.new(*provider.build(", EmptyService"))
19
- end
20
-
21
- end
22
-
23
- class Processor
24
- include ::Thrift::Processor
25
-
26
- end
27
-
28
- # HELPER FUNCTIONS AND STRUCTURES
29
-
30
- end
31
-
@@ -1,90 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'srv'
9
- require 'debug_proto_test_types'
10
-
11
- module Inherited
12
- SERVICE_NAME = "Inherited"
13
- PROGRAM_NAME = ""
14
-
15
- class Client < ::Srv::Client
16
- include ::Thrift::Client
17
-
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
27
- end
28
-
29
- def send_identity(ctx, arg)
30
- send_message('identity', Identity_args, :arg => arg)
31
- end
32
-
33
- def recv_identity(ctx)
34
- result = receive_message(Identity_result)
35
- return result.success unless result.success.nil?
36
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result')
37
- end
38
-
39
- end
40
-
41
- class Processor < ::Srv::Processor
42
- include ::Thrift::Processor
43
-
44
- def process_identity(ctx, seqid, iprot, oprot)
45
- args = read_args(iprot, Identity_args)
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
51
- end
52
-
53
- end
54
-
55
- # HELPER FUNCTIONS AND STRUCTURES
56
-
57
- class Identity_args
58
- include ::Thrift::Struct, ::Thrift::Struct_Union
59
- ARG = 1
60
-
61
- FIELDS = {
62
- ARG => {:type => ::Thrift::Types::I32, :name => 'arg'}
63
- }
64
-
65
- def struct_fields; FIELDS; end
66
-
67
- def validate
68
- end
69
-
70
- ::Thrift::Struct.generate_accessors self
71
- end
72
-
73
- class Identity_result
74
- include ::Thrift::Struct, ::Thrift::Struct_Union
75
- SUCCESS = 0
76
-
77
- FIELDS = {
78
- SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
79
- }
80
-
81
- def struct_fields; FIELDS; end
82
-
83
- def validate
84
- end
85
-
86
- ::Thrift::Struct.generate_accessors self
87
- end
88
-
89
- end
90
-
@@ -1,93 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'debug_proto_test_types'
9
-
10
- module ReverseOrderService
11
- SERVICE_NAME = "ReverseOrderService"
12
- PROGRAM_NAME = ""
13
-
14
- class Client
15
- include ::Thrift::Client
16
-
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
26
- end
27
-
28
- def send_myMethod(ctx, first, second, third, fourth)
29
- send_message('myMethod', MyMethod_args, :first => first, :second => second, :third => third, :fourth => fourth)
30
- end
31
-
32
- def recv_myMethod(ctx)
33
- result = receive_message(MyMethod_result)
34
- return
35
- end
36
-
37
- end
38
-
39
- class Processor
40
- include ::Thrift::Processor
41
-
42
- def process_myMethod(ctx, seqid, iprot, oprot)
43
- args = read_args(iprot, MyMethod_args)
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
49
- end
50
-
51
- end
52
-
53
- # HELPER FUNCTIONS AND STRUCTURES
54
-
55
- class MyMethod_args
56
- include ::Thrift::Struct, ::Thrift::Struct_Union
57
- FIRST = 4
58
- SECOND = 3
59
- THIRD = 2
60
- FOURTH = 1
61
-
62
- FIELDS = {
63
- FIRST => {:type => ::Thrift::Types::STRING, :name => 'first'},
64
- SECOND => {:type => ::Thrift::Types::I16, :name => 'second'},
65
- THIRD => {:type => ::Thrift::Types::I32, :name => 'third'},
66
- FOURTH => {:type => ::Thrift::Types::I64, :name => 'fourth'}
67
- }
68
-
69
- def struct_fields; FIELDS; end
70
-
71
- def validate
72
- end
73
-
74
- ::Thrift::Struct.generate_accessors self
75
- end
76
-
77
- class MyMethod_result
78
- include ::Thrift::Struct, ::Thrift::Struct_Union
79
-
80
- FIELDS = {
81
-
82
- }
83
-
84
- def struct_fields; FIELDS; end
85
-
86
- def validate
87
- end
88
-
89
- ::Thrift::Struct.generate_accessors self
90
- end
91
-
92
- end
93
-
@@ -1,92 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'debug_proto_test_types'
9
-
10
- module ServiceForExceptionWithAMap
11
- SERVICE_NAME = "ServiceForExceptionWithAMap"
12
- PROGRAM_NAME = ""
13
-
14
- class Client
15
- include ::Thrift::Client
16
-
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
26
- end
27
-
28
- def send_methodThatThrowsAnException(ctx)
29
- send_message('methodThatThrowsAnException', MethodThatThrowsAnException_args)
30
- end
31
-
32
- def recv_methodThatThrowsAnException(ctx)
33
- result = receive_message(MethodThatThrowsAnException_result)
34
- raise result.xwamap unless result.xwamap.nil?
35
- return
36
- end
37
-
38
- end
39
-
40
- class Processor
41
- include ::Thrift::Processor
42
-
43
- def process_methodThatThrowsAnException(ctx, seqid, iprot, oprot)
44
- args = read_args(iprot, MethodThatThrowsAnException_args)
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)
53
- end
54
- end
55
-
56
- end
57
-
58
- # HELPER FUNCTIONS AND STRUCTURES
59
-
60
- class MethodThatThrowsAnException_args
61
- include ::Thrift::Struct, ::Thrift::Struct_Union
62
-
63
- FIELDS = {
64
-
65
- }
66
-
67
- def struct_fields; FIELDS; end
68
-
69
- def validate
70
- end
71
-
72
- ::Thrift::Struct.generate_accessors self
73
- end
74
-
75
- class MethodThatThrowsAnException_result
76
- include ::Thrift::Struct, ::Thrift::Struct_Union
77
- XWAMAP = 1
78
-
79
- FIELDS = {
80
- XWAMAP => {:type => ::Thrift::Types::STRUCT, :name => 'xwamap', :class => ::ExceptionWithAMap}
81
- }
82
-
83
- def struct_fields; FIELDS; end
84
-
85
- def validate
86
- end
87
-
88
- ::Thrift::Struct.generate_accessors self
89
- end
90
-
91
- end
92
-
@@ -1,361 +0,0 @@
1
- #
2
- # Autogenerated by Thrift Compiler (2.0.1-upfluence)
3
- #
4
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
- #
6
-
7
- require 'thrift'
8
- require 'debug_proto_test_types'
9
-
10
- module Srv
11
- SERVICE_NAME = "Srv"
12
- PROGRAM_NAME = ""
13
-
14
- class Client
15
- include ::Thrift::Client
16
-
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
26
- end
27
-
28
- def send_Janky(ctx, arg)
29
- send_message('Janky', Janky_args, :arg => arg)
30
- end
31
-
32
- def recv_Janky(ctx)
33
- result = receive_message(Janky_result)
34
- return result.success unless result.success.nil?
35
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'Janky failed: unknown result')
36
- end
37
-
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
43
- end
44
-
45
- def send_voidMethod(ctx)
46
- send_message('voidMethod', VoidMethod_args)
47
- end
48
-
49
- def recv_voidMethod(ctx)
50
- result = receive_message(VoidMethod_result)
51
- return
52
- end
53
-
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
59
- end
60
-
61
- def send_primitiveMethod(ctx)
62
- send_message('primitiveMethod', PrimitiveMethod_args)
63
- end
64
-
65
- def recv_primitiveMethod(ctx)
66
- result = receive_message(PrimitiveMethod_result)
67
- return result.success unless result.success.nil?
68
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'primitiveMethod failed: unknown result')
69
- end
70
-
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
76
- end
77
-
78
- def send_structMethod(ctx)
79
- send_message('structMethod', StructMethod_args)
80
- end
81
-
82
- def recv_structMethod(ctx)
83
- result = receive_message(StructMethod_result)
84
- return result.success unless result.success.nil?
85
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'structMethod failed: unknown result')
86
- end
87
-
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
93
- end
94
-
95
- def send_methodWithDefaultArgs(ctx, something)
96
- send_message('methodWithDefaultArgs', MethodWithDefaultArgs_args, :something => something)
97
- end
98
-
99
- def recv_methodWithDefaultArgs(ctx)
100
- result = receive_message(MethodWithDefaultArgs_result)
101
- return
102
- end
103
-
104
- def onewayMethod(ctx)
105
- @middleware.handle_unary(ctx, 'onewayMethod', OnewayMethod_args.new()) do |ctx, args|
106
- send_onewayMethod(ctx, )
107
- end
108
- end
109
-
110
- def send_onewayMethod(ctx)
111
- send_oneway_message('onewayMethod', OnewayMethod_args)
112
- end
113
- end
114
-
115
- class Processor
116
- include ::Thrift::Processor
117
-
118
- def process_Janky(ctx, seqid, iprot, oprot)
119
- args = read_args(iprot, Janky_args)
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
125
- end
126
-
127
- def process_voidMethod(ctx, seqid, iprot, oprot)
128
- args = read_args(iprot, VoidMethod_args)
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
134
- end
135
-
136
- def process_primitiveMethod(ctx, seqid, iprot, oprot)
137
- args = read_args(iprot, PrimitiveMethod_args)
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
143
- end
144
-
145
- def process_structMethod(ctx, seqid, iprot, oprot)
146
- args = read_args(iprot, StructMethod_args)
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
152
- end
153
-
154
- def process_methodWithDefaultArgs(ctx, seqid, iprot, oprot)
155
- args = read_args(iprot, MethodWithDefaultArgs_args)
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
161
- end
162
-
163
- def process_onewayMethod(ctx, seqid, iprot, oprot)
164
- args = read_args(iprot, OnewayMethod_args)
165
- @middleware.handle_unary(ctx, 'onewayMethod', args) do |ctx, args|
166
- @handler.onewayMethod(ctx, )
167
- return
168
- end
169
- end
170
-
171
- end
172
-
173
- # HELPER FUNCTIONS AND STRUCTURES
174
-
175
- class Janky_args
176
- include ::Thrift::Struct, ::Thrift::Struct_Union
177
- ARG = 1
178
-
179
- FIELDS = {
180
- ARG => {:type => ::Thrift::Types::I32, :name => 'arg'}
181
- }
182
-
183
- def struct_fields; FIELDS; end
184
-
185
- def validate
186
- end
187
-
188
- ::Thrift::Struct.generate_accessors self
189
- end
190
-
191
- class Janky_result
192
- include ::Thrift::Struct, ::Thrift::Struct_Union
193
- SUCCESS = 0
194
-
195
- FIELDS = {
196
- SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
197
- }
198
-
199
- def struct_fields; FIELDS; end
200
-
201
- def validate
202
- end
203
-
204
- ::Thrift::Struct.generate_accessors self
205
- end
206
-
207
- class VoidMethod_args
208
- include ::Thrift::Struct, ::Thrift::Struct_Union
209
-
210
- FIELDS = {
211
-
212
- }
213
-
214
- def struct_fields; FIELDS; end
215
-
216
- def validate
217
- end
218
-
219
- ::Thrift::Struct.generate_accessors self
220
- end
221
-
222
- class VoidMethod_result
223
- include ::Thrift::Struct, ::Thrift::Struct_Union
224
-
225
- FIELDS = {
226
-
227
- }
228
-
229
- def struct_fields; FIELDS; end
230
-
231
- def validate
232
- end
233
-
234
- ::Thrift::Struct.generate_accessors self
235
- end
236
-
237
- class PrimitiveMethod_args
238
- include ::Thrift::Struct, ::Thrift::Struct_Union
239
-
240
- FIELDS = {
241
-
242
- }
243
-
244
- def struct_fields; FIELDS; end
245
-
246
- def validate
247
- end
248
-
249
- ::Thrift::Struct.generate_accessors self
250
- end
251
-
252
- class PrimitiveMethod_result
253
- include ::Thrift::Struct, ::Thrift::Struct_Union
254
- SUCCESS = 0
255
-
256
- FIELDS = {
257
- SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
258
- }
259
-
260
- def struct_fields; FIELDS; end
261
-
262
- def validate
263
- end
264
-
265
- ::Thrift::Struct.generate_accessors self
266
- end
267
-
268
- class StructMethod_args
269
- include ::Thrift::Struct, ::Thrift::Struct_Union
270
-
271
- FIELDS = {
272
-
273
- }
274
-
275
- def struct_fields; FIELDS; end
276
-
277
- def validate
278
- end
279
-
280
- ::Thrift::Struct.generate_accessors self
281
- end
282
-
283
- class StructMethod_result
284
- include ::Thrift::Struct, ::Thrift::Struct_Union
285
- SUCCESS = 0
286
-
287
- FIELDS = {
288
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::CompactProtoTestStruct}
289
- }
290
-
291
- def struct_fields; FIELDS; end
292
-
293
- def validate
294
- end
295
-
296
- ::Thrift::Struct.generate_accessors self
297
- end
298
-
299
- class MethodWithDefaultArgs_args
300
- include ::Thrift::Struct, ::Thrift::Struct_Union
301
- SOMETHING = 1
302
-
303
- FIELDS = {
304
- SOMETHING => {:type => ::Thrift::Types::I32, :name => 'something', :default => 2}
305
- }
306
-
307
- def struct_fields; FIELDS; end
308
-
309
- def validate
310
- end
311
-
312
- ::Thrift::Struct.generate_accessors self
313
- end
314
-
315
- class MethodWithDefaultArgs_result
316
- include ::Thrift::Struct, ::Thrift::Struct_Union
317
-
318
- FIELDS = {
319
-
320
- }
321
-
322
- def struct_fields; FIELDS; end
323
-
324
- def validate
325
- end
326
-
327
- ::Thrift::Struct.generate_accessors self
328
- end
329
-
330
- class OnewayMethod_args
331
- include ::Thrift::Struct, ::Thrift::Struct_Union
332
-
333
- FIELDS = {
334
-
335
- }
336
-
337
- def struct_fields; FIELDS; end
338
-
339
- def validate
340
- end
341
-
342
- ::Thrift::Struct.generate_accessors self
343
- end
344
-
345
- class OnewayMethod_result
346
- include ::Thrift::Struct, ::Thrift::Struct_Union
347
-
348
- FIELDS = {
349
-
350
- }
351
-
352
- def struct_fields; FIELDS; end
353
-
354
- def validate
355
- end
356
-
357
- ::Thrift::Struct.generate_accessors self
358
- end
359
-
360
- end
361
-