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,10 +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
-
9
- module ThriftBenchmark
10
- end
@@ -1,91 +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 'base/base_service_types'
9
-
10
- module Base
11
- module BaseService
12
- SERVICE_NAME = "BaseService"
13
- PROGRAM_NAME = ""
14
-
15
- class Client
16
- include ::Thrift::Client
17
-
18
- def self.from_provider(provider)
19
- Client.new(*provider.build(", BaseService"))
20
- end
21
-
22
- def greeting(ctx, english)
23
- @middleware.handle_binary(ctx, 'greeting', Greeting_args.new(:english => english)) do |ctx, args|
24
- send_greeting(ctx, args.english)
25
- return recv_greeting(ctx)
26
- end
27
- end
28
-
29
- def send_greeting(ctx, english)
30
- send_message('greeting', Greeting_args, :english => english)
31
- end
32
-
33
- def recv_greeting(ctx)
34
- result = receive_message(Greeting_result)
35
- return result.success unless result.success.nil?
36
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'greeting failed: unknown result')
37
- end
38
-
39
- end
40
-
41
- class Processor
42
- include ::Thrift::Processor
43
-
44
- def process_greeting(ctx, seqid, iprot, oprot)
45
- args = read_args(iprot, Greeting_args)
46
- @middleware.handle_binary(ctx, 'greeting', args) do |ctx, args|
47
- result = Greeting_result.new()
48
- result.success = @handler.greeting(ctx, args.english)
49
- write_result(result, oprot, 'greeting', seqid)
50
- end
51
- end
52
-
53
- end
54
-
55
- # HELPER FUNCTIONS AND STRUCTURES
56
-
57
- class Greeting_args
58
- include ::Thrift::Struct, ::Thrift::Struct_Union
59
- ENGLISH = 1
60
-
61
- FIELDS = {
62
- ENGLISH => {:type => ::Thrift::Types::BOOL, :name => 'english'}
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 Greeting_result
74
- include ::Thrift::Struct, ::Thrift::Struct_Union
75
- SUCCESS = 0
76
-
77
- FIELDS = {
78
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Base::Hello}
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
-
91
- end
@@ -1,11 +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 'base/base_service_types'
9
-
10
- module Base
11
- end
@@ -1,26 +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
-
9
- module Base
10
- class Hello
11
- include ::Thrift::Struct, ::Thrift::Struct_Union
12
- GREETING = 1
13
-
14
- FIELDS = {
15
- GREETING => {:type => ::Thrift::Types::STRING, :name => 'greeting', :default => %q"hello world"}
16
- }
17
-
18
- def struct_fields; FIELDS; end
19
-
20
- def validate
21
- end
22
-
23
- ::Thrift::Struct.generate_accessors self
24
- end
25
-
26
- end
@@ -1,89 +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 'base/base_service'
9
- require 'extended/extended_service_types'
10
-
11
- module Extended
12
- module ExtendedService
13
- SERVICE_NAME = "ExtendedService"
14
- PROGRAM_NAME = ""
15
-
16
- class Client < ::Base::BaseService::Client
17
- include ::Thrift::Client
18
-
19
- def self.from_provider(provider)
20
- Client.new(*provider.build(", ExtendedService"))
21
- end
22
-
23
- def ping(ctx)
24
- @middleware.handle_binary(ctx, 'ping', Ping_args.new()) do |ctx, args|
25
- send_ping(ctx, )
26
- recv_ping(ctx)
27
- end
28
- end
29
-
30
- def send_ping(ctx)
31
- send_message('ping', Ping_args)
32
- end
33
-
34
- def recv_ping(ctx)
35
- result = receive_message(Ping_result)
36
- return
37
- end
38
-
39
- end
40
-
41
- class Processor < ::Base::BaseService::Processor
42
- include ::Thrift::Processor
43
-
44
- def process_ping(ctx, seqid, iprot, oprot)
45
- args = read_args(iprot, Ping_args)
46
- @middleware.handle_binary(ctx, 'ping', args) do |ctx, args|
47
- result = Ping_result.new()
48
- @handler.ping(ctx, )
49
- write_result(result, oprot, 'ping', seqid)
50
- end
51
- end
52
-
53
- end
54
-
55
- # HELPER FUNCTIONS AND STRUCTURES
56
-
57
- class Ping_args
58
- include ::Thrift::Struct, ::Thrift::Struct_Union
59
-
60
- FIELDS = {
61
-
62
- }
63
-
64
- def struct_fields; FIELDS; end
65
-
66
- def validate
67
- end
68
-
69
- ::Thrift::Struct.generate_accessors self
70
- end
71
-
72
- class Ping_result
73
- include ::Thrift::Struct, ::Thrift::Struct_Union
74
-
75
- FIELDS = {
76
-
77
- }
78
-
79
- def struct_fields; FIELDS; end
80
-
81
- def validate
82
- end
83
-
84
- ::Thrift::Struct.generate_accessors self
85
- end
86
-
87
- end
88
-
89
- end
@@ -1,11 +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 'extended/extended_service_types'
9
-
10
- module Extended
11
- end
@@ -1,12 +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 'base/base_service_types'
9
-
10
-
11
- module Extended
12
- end
@@ -1,299 +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 'thrift_namespaced_spec_types'
9
-
10
- module NamespacedSpecNamespace
11
- module NamespacedNonblockingService
12
- SERVICE_NAME = "NamespacedNonblockingService"
13
- PROGRAM_NAME = ""
14
-
15
- class Client
16
- include ::Thrift::Client
17
-
18
- def self.from_provider(provider)
19
- Client.new(*provider.build(", NamespacedNonblockingService"))
20
- end
21
-
22
- def greeting(ctx, english)
23
- @middleware.handle_binary(ctx, 'greeting', Greeting_args.new(:english => english)) do |ctx, args|
24
- send_greeting(ctx, args.english)
25
- return recv_greeting(ctx)
26
- end
27
- end
28
-
29
- def send_greeting(ctx, english)
30
- send_message('greeting', Greeting_args, :english => english)
31
- end
32
-
33
- def recv_greeting(ctx)
34
- result = receive_message(Greeting_result)
35
- return result.success unless result.success.nil?
36
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'greeting failed: unknown result')
37
- end
38
-
39
- def block(ctx)
40
- @middleware.handle_binary(ctx, 'block', Block_args.new()) do |ctx, args|
41
- send_block(ctx, )
42
- return recv_block(ctx)
43
- end
44
- end
45
-
46
- def send_block(ctx)
47
- send_message('block', Block_args)
48
- end
49
-
50
- def recv_block(ctx)
51
- result = receive_message(Block_result)
52
- return result.success unless result.success.nil?
53
- raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'block failed: unknown result')
54
- end
55
-
56
- def unblock(ctx, n)
57
- @middleware.handle_unary(ctx, 'unblock', Unblock_args.new(:n => n)) do |ctx, args|
58
- send_unblock(ctx, args.n)
59
- end
60
- end
61
-
62
- def send_unblock(ctx, n)
63
- send_oneway_message('unblock', Unblock_args, :n => n)
64
- end
65
- def shutdown(ctx)
66
- @middleware.handle_unary(ctx, 'shutdown', Shutdown_args.new()) do |ctx, args|
67
- send_shutdown(ctx, )
68
- end
69
- end
70
-
71
- def send_shutdown(ctx)
72
- send_oneway_message('shutdown', Shutdown_args)
73
- end
74
- def sleep(ctx, seconds)
75
- @middleware.handle_binary(ctx, 'sleep', Sleep_args.new(:seconds => seconds)) do |ctx, args|
76
- send_sleep(ctx, args.seconds)
77
- recv_sleep(ctx)
78
- end
79
- end
80
-
81
- def send_sleep(ctx, seconds)
82
- send_message('sleep', Sleep_args, :seconds => seconds)
83
- end
84
-
85
- def recv_sleep(ctx)
86
- result = receive_message(Sleep_result)
87
- return
88
- end
89
-
90
- end
91
-
92
- class Processor
93
- include ::Thrift::Processor
94
-
95
- def process_greeting(ctx, seqid, iprot, oprot)
96
- args = read_args(iprot, Greeting_args)
97
- @middleware.handle_binary(ctx, 'greeting', args) do |ctx, args|
98
- result = Greeting_result.new()
99
- result.success = @handler.greeting(ctx, args.english)
100
- write_result(result, oprot, 'greeting', seqid)
101
- end
102
- end
103
-
104
- def process_block(ctx, seqid, iprot, oprot)
105
- args = read_args(iprot, Block_args)
106
- @middleware.handle_binary(ctx, 'block', args) do |ctx, args|
107
- result = Block_result.new()
108
- result.success = @handler.block(ctx, )
109
- write_result(result, oprot, 'block', seqid)
110
- end
111
- end
112
-
113
- def process_unblock(ctx, seqid, iprot, oprot)
114
- args = read_args(iprot, Unblock_args)
115
- @middleware.handle_unary(ctx, 'unblock', args) do |ctx, args|
116
- @handler.unblock(ctx, args.n)
117
- return
118
- end
119
- end
120
-
121
- def process_shutdown(ctx, seqid, iprot, oprot)
122
- args = read_args(iprot, Shutdown_args)
123
- @middleware.handle_unary(ctx, 'shutdown', args) do |ctx, args|
124
- @handler.shutdown(ctx, )
125
- return
126
- end
127
- end
128
-
129
- def process_sleep(ctx, seqid, iprot, oprot)
130
- args = read_args(iprot, Sleep_args)
131
- @middleware.handle_binary(ctx, 'sleep', args) do |ctx, args|
132
- result = Sleep_result.new()
133
- @handler.sleep(ctx, args.seconds)
134
- write_result(result, oprot, 'sleep', seqid)
135
- end
136
- end
137
-
138
- end
139
-
140
- # HELPER FUNCTIONS AND STRUCTURES
141
-
142
- class Greeting_args
143
- include ::Thrift::Struct, ::Thrift::Struct_Union
144
- ENGLISH = 1
145
-
146
- FIELDS = {
147
- ENGLISH => {:type => ::Thrift::Types::BOOL, :name => 'english'}
148
- }
149
-
150
- def struct_fields; FIELDS; end
151
-
152
- def validate
153
- end
154
-
155
- ::Thrift::Struct.generate_accessors self
156
- end
157
-
158
- class Greeting_result
159
- include ::Thrift::Struct, ::Thrift::Struct_Union
160
- SUCCESS = 0
161
-
162
- FIELDS = {
163
- SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::NamespacedSpecNamespace::Hello}
164
- }
165
-
166
- def struct_fields; FIELDS; end
167
-
168
- def validate
169
- end
170
-
171
- ::Thrift::Struct.generate_accessors self
172
- end
173
-
174
- class Block_args
175
- include ::Thrift::Struct, ::Thrift::Struct_Union
176
-
177
- FIELDS = {
178
-
179
- }
180
-
181
- def struct_fields; FIELDS; end
182
-
183
- def validate
184
- end
185
-
186
- ::Thrift::Struct.generate_accessors self
187
- end
188
-
189
- class Block_result
190
- include ::Thrift::Struct, ::Thrift::Struct_Union
191
- SUCCESS = 0
192
-
193
- FIELDS = {
194
- SUCCESS => {:type => ::Thrift::Types::BOOL, :name => 'success'}
195
- }
196
-
197
- def struct_fields; FIELDS; end
198
-
199
- def validate
200
- end
201
-
202
- ::Thrift::Struct.generate_accessors self
203
- end
204
-
205
- class Unblock_args
206
- include ::Thrift::Struct, ::Thrift::Struct_Union
207
- N = 1
208
-
209
- FIELDS = {
210
- N => {:type => ::Thrift::Types::I32, :name => 'n'}
211
- }
212
-
213
- def struct_fields; FIELDS; end
214
-
215
- def validate
216
- end
217
-
218
- ::Thrift::Struct.generate_accessors self
219
- end
220
-
221
- class Unblock_result
222
- include ::Thrift::Struct, ::Thrift::Struct_Union
223
-
224
- FIELDS = {
225
-
226
- }
227
-
228
- def struct_fields; FIELDS; end
229
-
230
- def validate
231
- end
232
-
233
- ::Thrift::Struct.generate_accessors self
234
- end
235
-
236
- class Shutdown_args
237
- include ::Thrift::Struct, ::Thrift::Struct_Union
238
-
239
- FIELDS = {
240
-
241
- }
242
-
243
- def struct_fields; FIELDS; end
244
-
245
- def validate
246
- end
247
-
248
- ::Thrift::Struct.generate_accessors self
249
- end
250
-
251
- class Shutdown_result
252
- include ::Thrift::Struct, ::Thrift::Struct_Union
253
-
254
- FIELDS = {
255
-
256
- }
257
-
258
- def struct_fields; FIELDS; end
259
-
260
- def validate
261
- end
262
-
263
- ::Thrift::Struct.generate_accessors self
264
- end
265
-
266
- class Sleep_args
267
- include ::Thrift::Struct, ::Thrift::Struct_Union
268
- SECONDS = 1
269
-
270
- FIELDS = {
271
- SECONDS => {:type => ::Thrift::Types::DOUBLE, :name => 'seconds'}
272
- }
273
-
274
- def struct_fields; FIELDS; end
275
-
276
- def validate
277
- end
278
-
279
- ::Thrift::Struct.generate_accessors self
280
- end
281
-
282
- class Sleep_result
283
- include ::Thrift::Struct, ::Thrift::Struct_Union
284
-
285
- FIELDS = {
286
-
287
- }
288
-
289
- def struct_fields; FIELDS; end
290
-
291
- def validate
292
- end
293
-
294
- ::Thrift::Struct.generate_accessors self
295
- end
296
-
297
- end
298
-
299
- end