upfluence-thrift 2.3.0 → 2.4.4
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.
- checksums.yaml +4 -4
- data/benchmark/gen-rb/benchmark_constants.rb +11 -0
- data/benchmark/gen-rb/benchmark_service.rb +106 -0
- data/benchmark/gen-rb/benchmark_types.rb +10 -0
- data/ext/extconf.rb +1 -4
- data/lib/thrift/protocol/json_protocol.rb +65 -1
- data/spec/gen-rb/base/base_service.rb +106 -0
- data/spec/gen-rb/base/base_service_constants.rb +11 -0
- data/spec/gen-rb/base/base_service_types.rb +33 -0
- data/spec/gen-rb/extended/extended_service.rb +103 -0
- data/spec/gen-rb/extended/extended_service_constants.rb +11 -0
- data/spec/gen-rb/extended/extended_service_types.rb +12 -0
- data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +343 -0
- data/spec/gen-rb/flat/referenced_constants.rb +11 -0
- data/spec/gen-rb/flat/referenced_types.rb +17 -0
- data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +11 -0
- data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +35 -0
- data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +343 -0
- data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +11 -0
- data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +35 -0
- data/spec/gen-rb/nonblocking_service.rb +343 -0
- data/spec/gen-rb/other_namespace/referenced_constants.rb +11 -0
- data/spec/gen-rb/other_namespace/referenced_types.rb +17 -0
- data/spec/gen-rb/thrift_spec_constants.rb +11 -0
- data/spec/gen-rb/thrift_spec_types.rb +699 -0
- data/spec/json_protocol_spec.rb +17 -0
- data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +274 -0
- data/test/debug_proto/gen-rb/debug_proto_test_types.rb +936 -0
- data/test/debug_proto/gen-rb/empty_service.rb +39 -0
- data/test/debug_proto/gen-rb/inherited.rb +105 -0
- data/test/debug_proto/gen-rb/reverse_order_service.rb +107 -0
- data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +106 -0
- data/test/debug_proto/gen-rb/srv.rb +410 -0
- metadata +150 -92
@@ -0,0 +1,410 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift Compiler (2.4.0-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 = 'Srv'.freeze
|
12
|
+
NAMESPACE = ''.freeze
|
13
|
+
|
14
|
+
class Client
|
15
|
+
def initialize(client)
|
16
|
+
@client = ::Thrift.build_client(client)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.from_provider(provider)
|
20
|
+
Client.new(provider.build(NAMESPACE, SERVICE))
|
21
|
+
end
|
22
|
+
|
23
|
+
def Janky(arg)
|
24
|
+
result = @client.call_binary(
|
25
|
+
'Janky',
|
26
|
+
Janky_args.new(arg: arg),
|
27
|
+
Janky_result
|
28
|
+
)
|
29
|
+
|
30
|
+
return result.success unless result.success.nil?
|
31
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'Janky failed: unknown result')
|
32
|
+
result
|
33
|
+
end
|
34
|
+
|
35
|
+
def voidMethod()
|
36
|
+
result = @client.call_binary(
|
37
|
+
'voidMethod',
|
38
|
+
VoidMethod_args.new(),
|
39
|
+
VoidMethod_result
|
40
|
+
)
|
41
|
+
|
42
|
+
nil
|
43
|
+
end
|
44
|
+
|
45
|
+
def primitiveMethod()
|
46
|
+
result = @client.call_binary(
|
47
|
+
'primitiveMethod',
|
48
|
+
PrimitiveMethod_args.new(),
|
49
|
+
PrimitiveMethod_result
|
50
|
+
)
|
51
|
+
|
52
|
+
return result.success unless result.success.nil?
|
53
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'primitiveMethod failed: unknown result')
|
54
|
+
result
|
55
|
+
end
|
56
|
+
|
57
|
+
def structMethod()
|
58
|
+
result = @client.call_binary(
|
59
|
+
'structMethod',
|
60
|
+
StructMethod_args.new(),
|
61
|
+
StructMethod_result
|
62
|
+
)
|
63
|
+
|
64
|
+
return result.success unless result.success.nil?
|
65
|
+
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'structMethod failed: unknown result')
|
66
|
+
result
|
67
|
+
end
|
68
|
+
|
69
|
+
def methodWithDefaultArgs(something)
|
70
|
+
result = @client.call_binary(
|
71
|
+
'methodWithDefaultArgs',
|
72
|
+
MethodWithDefaultArgs_args.new(something: something),
|
73
|
+
MethodWithDefaultArgs_result
|
74
|
+
)
|
75
|
+
|
76
|
+
nil
|
77
|
+
end
|
78
|
+
|
79
|
+
def onewayMethod()
|
80
|
+
@client.call_unary(
|
81
|
+
'onewayMethod',
|
82
|
+
OnewayMethod_args.new()
|
83
|
+
)
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
class Processor
|
89
|
+
include ::Thrift::Processor
|
90
|
+
|
91
|
+
def self.from_provider(handler, provider)
|
92
|
+
provider.build(NAMESPACE, SERVICE, Processor, handler)
|
93
|
+
end
|
94
|
+
|
95
|
+
def process_Janky(seqid, iprot, oprot)
|
96
|
+
args = read_args(iprot, Janky_args)
|
97
|
+
result = @middleware.handle_binary('Janky', args) do |args|
|
98
|
+
result = Janky_result.new()
|
99
|
+
result.success = @handler.Janky(args.arg)
|
100
|
+
result
|
101
|
+
end
|
102
|
+
|
103
|
+
write_result(result, oprot, 'Janky', seqid)
|
104
|
+
end
|
105
|
+
|
106
|
+
def process_voidMethod(seqid, iprot, oprot)
|
107
|
+
args = read_args(iprot, VoidMethod_args)
|
108
|
+
result = @middleware.handle_binary('voidMethod', args) do |args|
|
109
|
+
result = VoidMethod_result.new()
|
110
|
+
@handler.voidMethod()
|
111
|
+
result
|
112
|
+
end
|
113
|
+
|
114
|
+
write_result(result, oprot, 'voidMethod', seqid)
|
115
|
+
end
|
116
|
+
|
117
|
+
def process_primitiveMethod(seqid, iprot, oprot)
|
118
|
+
args = read_args(iprot, PrimitiveMethod_args)
|
119
|
+
result = @middleware.handle_binary('primitiveMethod', args) do |args|
|
120
|
+
result = PrimitiveMethod_result.new()
|
121
|
+
result.success = @handler.primitiveMethod()
|
122
|
+
result
|
123
|
+
end
|
124
|
+
|
125
|
+
write_result(result, oprot, 'primitiveMethod', seqid)
|
126
|
+
end
|
127
|
+
|
128
|
+
def process_structMethod(seqid, iprot, oprot)
|
129
|
+
args = read_args(iprot, StructMethod_args)
|
130
|
+
result = @middleware.handle_binary('structMethod', args) do |args|
|
131
|
+
result = StructMethod_result.new()
|
132
|
+
result.success = @handler.structMethod()
|
133
|
+
result
|
134
|
+
end
|
135
|
+
|
136
|
+
write_result(result, oprot, 'structMethod', seqid)
|
137
|
+
end
|
138
|
+
|
139
|
+
def process_methodWithDefaultArgs(seqid, iprot, oprot)
|
140
|
+
args = read_args(iprot, MethodWithDefaultArgs_args)
|
141
|
+
result = @middleware.handle_binary('methodWithDefaultArgs', args) do |args|
|
142
|
+
result = MethodWithDefaultArgs_result.new()
|
143
|
+
@handler.methodWithDefaultArgs(args.something)
|
144
|
+
result
|
145
|
+
end
|
146
|
+
|
147
|
+
write_result(result, oprot, 'methodWithDefaultArgs', seqid)
|
148
|
+
end
|
149
|
+
|
150
|
+
def process_onewayMethod(seqid, iprot, oprot)
|
151
|
+
args = read_args(iprot, OnewayMethod_args)
|
152
|
+
@middleware.handle_unary('onewayMethod', args) do |args|
|
153
|
+
@handler.onewayMethod()
|
154
|
+
nil
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
end
|
159
|
+
|
160
|
+
# HELPER FUNCTIONS AND STRUCTURES
|
161
|
+
|
162
|
+
class Janky_args
|
163
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
164
|
+
|
165
|
+
NAME = 'Janky_args'.freeze
|
166
|
+
NAMESPACE = ''.freeze
|
167
|
+
|
168
|
+
THRIFT_FIELD_INDEX_ARG = 1
|
169
|
+
|
170
|
+
FIELDS = {
|
171
|
+
THRIFT_FIELD_INDEX_ARG => {type: ::Thrift::Types::I32, name: 'arg'}
|
172
|
+
}
|
173
|
+
|
174
|
+
def struct_fields; FIELDS; end
|
175
|
+
|
176
|
+
def validate
|
177
|
+
end
|
178
|
+
|
179
|
+
::Thrift::Struct.generate_accessors self
|
180
|
+
::Thrift.register_struct_type self
|
181
|
+
end
|
182
|
+
|
183
|
+
class Janky_result
|
184
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
185
|
+
|
186
|
+
NAME = 'Janky_result'.freeze
|
187
|
+
NAMESPACE = ''.freeze
|
188
|
+
|
189
|
+
THRIFT_FIELD_INDEX_SUCCESS = 0
|
190
|
+
|
191
|
+
FIELDS = {
|
192
|
+
THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'}
|
193
|
+
}
|
194
|
+
|
195
|
+
def struct_fields; FIELDS; end
|
196
|
+
|
197
|
+
def validate
|
198
|
+
end
|
199
|
+
|
200
|
+
::Thrift::Struct.generate_accessors self
|
201
|
+
::Thrift.register_struct_type self
|
202
|
+
end
|
203
|
+
|
204
|
+
class VoidMethod_args
|
205
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
206
|
+
|
207
|
+
NAME = 'voidMethod_args'.freeze
|
208
|
+
NAMESPACE = ''.freeze
|
209
|
+
|
210
|
+
|
211
|
+
FIELDS = {
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
def struct_fields; FIELDS; end
|
216
|
+
|
217
|
+
def validate
|
218
|
+
end
|
219
|
+
|
220
|
+
::Thrift::Struct.generate_accessors self
|
221
|
+
::Thrift.register_struct_type self
|
222
|
+
end
|
223
|
+
|
224
|
+
class VoidMethod_result
|
225
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
226
|
+
|
227
|
+
NAME = 'voidMethod_result'.freeze
|
228
|
+
NAMESPACE = ''.freeze
|
229
|
+
|
230
|
+
|
231
|
+
FIELDS = {
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
def struct_fields; FIELDS; end
|
236
|
+
|
237
|
+
def validate
|
238
|
+
end
|
239
|
+
|
240
|
+
::Thrift::Struct.generate_accessors self
|
241
|
+
::Thrift.register_struct_type self
|
242
|
+
end
|
243
|
+
|
244
|
+
class PrimitiveMethod_args
|
245
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
246
|
+
|
247
|
+
NAME = 'primitiveMethod_args'.freeze
|
248
|
+
NAMESPACE = ''.freeze
|
249
|
+
|
250
|
+
|
251
|
+
FIELDS = {
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
def struct_fields; FIELDS; end
|
256
|
+
|
257
|
+
def validate
|
258
|
+
end
|
259
|
+
|
260
|
+
::Thrift::Struct.generate_accessors self
|
261
|
+
::Thrift.register_struct_type self
|
262
|
+
end
|
263
|
+
|
264
|
+
class PrimitiveMethod_result
|
265
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
266
|
+
|
267
|
+
NAME = 'primitiveMethod_result'.freeze
|
268
|
+
NAMESPACE = ''.freeze
|
269
|
+
|
270
|
+
THRIFT_FIELD_INDEX_SUCCESS = 0
|
271
|
+
|
272
|
+
FIELDS = {
|
273
|
+
THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'}
|
274
|
+
}
|
275
|
+
|
276
|
+
def struct_fields; FIELDS; end
|
277
|
+
|
278
|
+
def validate
|
279
|
+
end
|
280
|
+
|
281
|
+
::Thrift::Struct.generate_accessors self
|
282
|
+
::Thrift.register_struct_type self
|
283
|
+
end
|
284
|
+
|
285
|
+
class StructMethod_args
|
286
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
287
|
+
|
288
|
+
NAME = 'structMethod_args'.freeze
|
289
|
+
NAMESPACE = ''.freeze
|
290
|
+
|
291
|
+
|
292
|
+
FIELDS = {
|
293
|
+
|
294
|
+
}
|
295
|
+
|
296
|
+
def struct_fields; FIELDS; end
|
297
|
+
|
298
|
+
def validate
|
299
|
+
end
|
300
|
+
|
301
|
+
::Thrift::Struct.generate_accessors self
|
302
|
+
::Thrift.register_struct_type self
|
303
|
+
end
|
304
|
+
|
305
|
+
class StructMethod_result
|
306
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
307
|
+
|
308
|
+
NAME = 'structMethod_result'.freeze
|
309
|
+
NAMESPACE = ''.freeze
|
310
|
+
|
311
|
+
THRIFT_FIELD_INDEX_SUCCESS = 0
|
312
|
+
|
313
|
+
FIELDS = {
|
314
|
+
THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::STRUCT, name: 'success', class: ::CompactProtoTestStruct}
|
315
|
+
}
|
316
|
+
|
317
|
+
def struct_fields; FIELDS; end
|
318
|
+
|
319
|
+
def validate
|
320
|
+
end
|
321
|
+
|
322
|
+
::Thrift::Struct.generate_accessors self
|
323
|
+
::Thrift.register_struct_type self
|
324
|
+
end
|
325
|
+
|
326
|
+
class MethodWithDefaultArgs_args
|
327
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
328
|
+
|
329
|
+
NAME = 'methodWithDefaultArgs_args'.freeze
|
330
|
+
NAMESPACE = ''.freeze
|
331
|
+
|
332
|
+
THRIFT_FIELD_INDEX_SOMETHING = 1
|
333
|
+
|
334
|
+
FIELDS = {
|
335
|
+
THRIFT_FIELD_INDEX_SOMETHING => {type: ::Thrift::Types::I32, name: 'something', default: 2}
|
336
|
+
}
|
337
|
+
|
338
|
+
def struct_fields; FIELDS; end
|
339
|
+
|
340
|
+
def validate
|
341
|
+
end
|
342
|
+
|
343
|
+
::Thrift::Struct.generate_accessors self
|
344
|
+
::Thrift.register_struct_type self
|
345
|
+
end
|
346
|
+
|
347
|
+
class MethodWithDefaultArgs_result
|
348
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
349
|
+
|
350
|
+
NAME = 'methodWithDefaultArgs_result'.freeze
|
351
|
+
NAMESPACE = ''.freeze
|
352
|
+
|
353
|
+
|
354
|
+
FIELDS = {
|
355
|
+
|
356
|
+
}
|
357
|
+
|
358
|
+
def struct_fields; FIELDS; end
|
359
|
+
|
360
|
+
def validate
|
361
|
+
end
|
362
|
+
|
363
|
+
::Thrift::Struct.generate_accessors self
|
364
|
+
::Thrift.register_struct_type self
|
365
|
+
end
|
366
|
+
|
367
|
+
class OnewayMethod_args
|
368
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
369
|
+
|
370
|
+
NAME = 'onewayMethod_args'.freeze
|
371
|
+
NAMESPACE = ''.freeze
|
372
|
+
|
373
|
+
|
374
|
+
FIELDS = {
|
375
|
+
|
376
|
+
}
|
377
|
+
|
378
|
+
def struct_fields; FIELDS; end
|
379
|
+
|
380
|
+
def validate
|
381
|
+
end
|
382
|
+
|
383
|
+
::Thrift::Struct.generate_accessors self
|
384
|
+
::Thrift.register_struct_type self
|
385
|
+
end
|
386
|
+
|
387
|
+
class OnewayMethod_result
|
388
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
389
|
+
|
390
|
+
NAME = 'onewayMethod_result'.freeze
|
391
|
+
NAMESPACE = ''.freeze
|
392
|
+
|
393
|
+
|
394
|
+
FIELDS = {
|
395
|
+
|
396
|
+
}
|
397
|
+
|
398
|
+
def struct_fields; FIELDS; end
|
399
|
+
|
400
|
+
def validate
|
401
|
+
end
|
402
|
+
|
403
|
+
::Thrift::Struct.generate_accessors self
|
404
|
+
::Thrift.register_struct_type self
|
405
|
+
end
|
406
|
+
|
407
|
+
::Thrift.register_service_type(self)
|
408
|
+
|
409
|
+
end
|
410
|
+
|