upfluence-thrift 2.1.1 → 2.2.0
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 +30 -9
- data/lib/thrift/definition.rb +45 -5
- data/lib/thrift/middleware.rb +13 -0
- data/lib/thrift/processor.rb +2 -9
- data/lib/thrift/struct.rb +10 -10
- data/lib/thrift/transport/server_socket.rb +6 -6
- metadata +2 -74
- data/benchmark/gen-rb/benchmark_constants.rb +0 -11
- data/benchmark/gen-rb/benchmark_service.rb +0 -91
- data/benchmark/gen-rb/benchmark_types.rb +0 -10
- data/spec/gen-rb/base/base_service.rb +0 -91
- data/spec/gen-rb/base/base_service_constants.rb +0 -11
- data/spec/gen-rb/base/base_service_types.rb +0 -26
- data/spec/gen-rb/extended/extended_service.rb +0 -89
- data/spec/gen-rb/extended/extended_service_constants.rb +0 -11
- data/spec/gen-rb/extended/extended_service_types.rb +0 -12
- data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +0 -299
- data/spec/gen-rb/flat/referenced_constants.rb +0 -11
- data/spec/gen-rb/flat/referenced_types.rb +0 -17
- data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +0 -11
- data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +0 -28
- data/spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb +0 -299
- data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +0 -11
- data/spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +0 -28
- data/spec/gen-rb/nonblocking_service.rb +0 -299
- data/spec/gen-rb/other_namespace/referenced_constants.rb +0 -11
- data/spec/gen-rb/other_namespace/referenced_types.rb +0 -17
- data/spec/gen-rb/thrift_spec_constants.rb +0 -11
- data/spec/gen-rb/thrift_spec_types.rb +0 -538
- data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +0 -274
- data/test/debug_proto/gen-rb/debug_proto_test_types.rb +0 -761
- data/test/debug_proto/gen-rb/empty_service.rb +0 -31
- data/test/debug_proto/gen-rb/inherited.rb +0 -90
- data/test/debug_proto/gen-rb/reverse_order_service.rb +0 -93
- data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +0 -92
- data/test/debug_proto/gen-rb/srv.rb +0 -361
@@ -1,17 +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 OtherNamespace
|
10
|
-
module SomeEnum
|
11
|
-
ONE = 0
|
12
|
-
TWO = 1
|
13
|
-
VALUE_MAP = {0 => "ONE", 1 => "TWO"}
|
14
|
-
VALID_VALUES = Set.new([ONE, TWO]).freeze
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,28 +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 'referenced_types'
|
9
|
-
|
10
|
-
|
11
|
-
module NamespacedSpecNamespace
|
12
|
-
class Hello
|
13
|
-
include ::Thrift::Struct, ::Thrift::Struct_Union
|
14
|
-
GREETING = 1
|
15
|
-
|
16
|
-
FIELDS = {
|
17
|
-
GREETING => {:type => ::Thrift::Types::STRING, :name => 'greeting', :default => %q"hello world"}
|
18
|
-
}
|
19
|
-
|
20
|
-
def struct_fields; FIELDS; end
|
21
|
-
|
22
|
-
def validate
|
23
|
-
end
|
24
|
-
|
25
|
-
::Thrift::Struct.generate_accessors self
|
26
|
-
end
|
27
|
-
|
28
|
-
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 'namespaced_spec_namespace/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
|
@@ -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 'namespaced_spec_namespace/thrift_namespaced_spec_types'
|
9
|
-
|
10
|
-
module NamespacedSpecNamespace
|
11
|
-
end
|
@@ -1,28 +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 'other_namespace/referenced_types'
|
9
|
-
|
10
|
-
|
11
|
-
module NamespacedSpecNamespace
|
12
|
-
class Hello
|
13
|
-
include ::Thrift::Struct, ::Thrift::Struct_Union
|
14
|
-
GREETING = 1
|
15
|
-
|
16
|
-
FIELDS = {
|
17
|
-
GREETING => {:type => ::Thrift::Types::STRING, :name => 'greeting', :default => %q"hello world"}
|
18
|
-
}
|
19
|
-
|
20
|
-
def struct_fields; FIELDS; end
|
21
|
-
|
22
|
-
def validate
|
23
|
-
end
|
24
|
-
|
25
|
-
::Thrift::Struct.generate_accessors self
|
26
|
-
end
|
27
|
-
|
28
|
-
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_spec_types'
|
9
|
-
|
10
|
-
module SpecNamespace
|
11
|
-
module NonblockingService
|
12
|
-
SERVICE_NAME = "NonblockingService"
|
13
|
-
PROGRAM_NAME = ""
|
14
|
-
|
15
|
-
class Client
|
16
|
-
include ::Thrift::Client
|
17
|
-
|
18
|
-
def self.from_provider(provider)
|
19
|
-
Client.new(*provider.build(", NonblockingService"))
|
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 => ::SpecNamespace::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
|