upfluence-thrift 1.1.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/extconf.rb +1 -4
- data/lib/thrift/client.rb +31 -1
- data/lib/thrift/definition.rb +64 -0
- data/lib/thrift/exceptions.rb +5 -5
- data/lib/thrift/middleware.rb +50 -0
- data/lib/thrift/processor.rb +3 -3
- data/lib/thrift/struct.rb +10 -10
- data/lib/thrift/transport/base_transport.rb +9 -7
- data/lib/thrift/transport/server_socket.rb +6 -6
- data/lib/thrift/types/known/any.rb +179 -0
- data/lib/thrift/types/known/any_constants.rb +17 -0
- data/lib/thrift/types/known/any_types.rb +43 -0
- data/lib/thrift/types/known/duration.rb +27 -0
- data/lib/thrift/types/known/duration_constants.rb +17 -0
- data/lib/thrift/types/known/duration_types.rb +43 -0
- data/lib/thrift/types/known/timestamp.rb +31 -0
- data/lib/thrift/types/known/timestamp_constants.rb +17 -0
- data/lib/thrift/types/known/timestamp_types.rb +43 -0
- data/lib/thrift/types/value.rb +114 -0
- data/lib/thrift/types/value_constants.rb +15 -0
- data/lib/thrift/types/value_types.rb +213 -0
- data/lib/thrift/types.rb +4 -4
- data/lib/thrift.rb +6 -4
- data/spec/binary_protocol_spec_shared.rb +57 -60
- data/spec/client_spec.rb +2 -2
- data/spec/compact_protocol_spec.rb +26 -20
- data/spec/http_client_spec.rb +7 -20
- data/spec/nonblocking_server_spec.rb +1 -1
- data/spec/processor_spec.rb +1 -1
- data/spec/struct_spec.rb +2 -2
- data/spec/types/known/any_spec.rb +44 -0
- data/spec/types/known/duration_spec.rb +20 -0
- data/spec/types/known/timestamp_spec.rb +17 -0
- data/spec/types/value_spec.rb +43 -0
- data/spec/types_spec.rb +2 -2
- metadata +114 -150
- 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
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
require 'thrift/types/value'
|
4
|
+
|
5
|
+
class LocalObject
|
6
|
+
def initialize(foo, bar)
|
7
|
+
@foo, @bar = foo, bar
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'Thrift::Types::Value' do
|
12
|
+
describe 'from_object' do
|
13
|
+
subject do
|
14
|
+
Thrift::Serializer.new(
|
15
|
+
Thrift::JsonProtocolFactory.new
|
16
|
+
).serialize(Thrift::Types::Value.from_object(obj))
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'utf-8 string' do
|
20
|
+
let(:obj) { 'foo' }
|
21
|
+
|
22
|
+
it do
|
23
|
+
subject.should == "{\"2\":{\"str\":\"foo\"}}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'complex hash' do
|
28
|
+
let(:obj) { { foo: true, baz: 0.5, buz: 1 } }
|
29
|
+
|
30
|
+
it do
|
31
|
+
subject.should == "{\"8\":{\"rec\":{\"1\":{\"lst\":[\"rec\",3,{\"1\":{\"rec\":{\"2\":{\"str\":\"foo\"}}},\"2\":{\"rec\":{\"6\":{\"tf\":1}}}},{\"1\":{\"rec\":{\"2\":{\"str\":\"baz\"}}},\"2\":{\"rec\":{\"5\":{\"dbl\":0.5}}}},{\"1\":{\"rec\":{\"2\":{\"str\":\"buz\"}}},\"2\":{\"rec\":{\"4\":{\"i64\":1}}}}]}}}}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'object' do
|
36
|
+
let(:obj) { LocalObject.new(1, true) }
|
37
|
+
|
38
|
+
it do
|
39
|
+
subject.should == "{\"9\":{\"rec\":{\"1\":{\"map\":[\"str\",\"rec\",2,{\"foo\":{\"4\":{\"i64\":1}},\"bar\":{\"6\":{\"tf\":1}}}]}}}}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/spec/types_spec.rb
CHANGED
@@ -97,9 +97,9 @@ describe Thrift::Types do
|
|
97
97
|
end
|
98
98
|
|
99
99
|
it "should give the Thrift::TypeError a readable message" do
|
100
|
-
msg = "Expected Types::STRING, received
|
100
|
+
msg = "Expected Types::STRING, received Integer for field foo"
|
101
101
|
lambda { Thrift.check_type(3, {:type => Thrift::Types::STRING}, :foo) }.should raise_error(Thrift::TypeError, msg)
|
102
|
-
msg = "Expected Types::STRING, received
|
102
|
+
msg = "Expected Types::STRING, received Integer for field foo.element"
|
103
103
|
field = {:type => Thrift::Types::LIST, :element => {:type => Thrift::Types::STRING}}
|
104
104
|
lambda { Thrift.check_type([3], field, :foo) }.should raise_error(Thrift::TypeError, msg)
|
105
105
|
msg = "Expected Types::I32, received NilClass for field foo.element.key"
|
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:
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thrift Developers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -94,20 +94,6 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: statsd-ruby
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
97
|
description: Ruby bindings for the Apache Thrift RPC system
|
112
98
|
email:
|
113
99
|
- dev@thrift.apache.org
|
@@ -116,74 +102,85 @@ extensions:
|
|
116
102
|
- ext/extconf.rb
|
117
103
|
extra_rdoc_files:
|
118
104
|
- README.md
|
119
|
-
- ext/strlcpy.c
|
120
|
-
- ext/bytes.c
|
121
105
|
- ext/binary_protocol_accelerated.c
|
106
|
+
- ext/bytes.c
|
122
107
|
- ext/compact_protocol.c
|
123
108
|
- ext/memory_buffer.c
|
124
109
|
- ext/protocol.c
|
125
|
-
- ext/
|
110
|
+
- ext/strlcpy.c
|
126
111
|
- ext/struct.c
|
127
|
-
- ext/
|
128
|
-
- ext/
|
129
|
-
- ext/constants.h
|
130
|
-
- ext/macros.h
|
112
|
+
- ext/thrift_native.c
|
113
|
+
- ext/binary_protocol_accelerated.h
|
131
114
|
- ext/bytes.h
|
132
|
-
- ext/strlcpy.h
|
133
115
|
- ext/compact_protocol.h
|
134
|
-
- ext/
|
116
|
+
- ext/constants.h
|
117
|
+
- ext/macros.h
|
135
118
|
- ext/memory_buffer.h
|
119
|
+
- ext/protocol.h
|
120
|
+
- ext/strlcpy.h
|
121
|
+
- ext/struct.h
|
136
122
|
- ext/extconf.rb
|
137
|
-
- lib/thrift.rb
|
138
|
-
- lib/thrift/core_ext.rb
|
139
|
-
- lib/thrift/struct_union.rb
|
140
|
-
- lib/thrift/struct.rb
|
141
|
-
- lib/thrift/union.rb
|
142
|
-
- lib/thrift/serializer/serializer.rb
|
143
|
-
- lib/thrift/serializer/deserializer.rb
|
144
|
-
- lib/thrift/transport/base_server_transport.rb
|
145
|
-
- lib/thrift/transport/framed_transport.rb
|
146
|
-
- lib/thrift/transport/socket.rb
|
147
|
-
- lib/thrift/transport/base_transport.rb
|
148
|
-
- lib/thrift/transport/server_socket.rb
|
149
|
-
- lib/thrift/transport/unix_socket.rb
|
150
|
-
- lib/thrift/transport/memory_buffer_transport.rb
|
151
|
-
- lib/thrift/transport/io_stream_transport.rb
|
152
|
-
- lib/thrift/transport/buffered_transport.rb
|
153
|
-
- lib/thrift/transport/unix_server_socket.rb
|
154
|
-
- lib/thrift/transport/http_client_transport.rb
|
155
123
|
- lib/thrift/bytes.rb
|
124
|
+
- lib/thrift/client.rb
|
156
125
|
- lib/thrift/core_ext/fixnum.rb
|
157
|
-
- lib/thrift/
|
158
|
-
- lib/thrift/
|
126
|
+
- lib/thrift/core_ext.rb
|
127
|
+
- lib/thrift/definition.rb
|
159
128
|
- lib/thrift/exceptions.rb
|
160
|
-
- lib/thrift/
|
161
|
-
- lib/thrift/
|
162
|
-
- lib/thrift/
|
163
|
-
- lib/thrift/
|
164
|
-
- lib/thrift/server/simple_server.rb
|
165
|
-
- lib/thrift/server/nonblocking_server.rb
|
166
|
-
- lib/thrift/server/thin_http_server.rb
|
167
|
-
- lib/thrift/server/base_server.rb
|
168
|
-
- lib/thrift/protocol/binary_protocol_accelerated.rb
|
129
|
+
- lib/thrift/metrics.rb
|
130
|
+
- lib/thrift/middleware.rb
|
131
|
+
- lib/thrift/multiplexed_processor.rb
|
132
|
+
- lib/thrift/processor.rb
|
169
133
|
- lib/thrift/protocol/base_protocol.rb
|
170
|
-
- lib/thrift/protocol/protocol_decorator.rb
|
171
|
-
- lib/thrift/protocol/json_protocol.rb
|
172
|
-
- lib/thrift/protocol/multiplexed_protocol.rb
|
173
134
|
- lib/thrift/protocol/binary_protocol.rb
|
135
|
+
- lib/thrift/protocol/binary_protocol_accelerated.rb
|
174
136
|
- lib/thrift/protocol/compact_protocol.rb
|
175
|
-
- lib/thrift/
|
137
|
+
- lib/thrift/protocol/json_protocol.rb
|
138
|
+
- lib/thrift/protocol/multiplexed_protocol.rb
|
139
|
+
- lib/thrift/protocol/protocol_decorator.rb
|
140
|
+
- lib/thrift/serializer/deserializer.rb
|
141
|
+
- lib/thrift/serializer/serializer.rb
|
142
|
+
- lib/thrift/server/base_server.rb
|
143
|
+
- lib/thrift/server/mongrel_http_server.rb
|
144
|
+
- lib/thrift/server/nonblocking_server.rb
|
145
|
+
- lib/thrift/server/rack_application.rb
|
146
|
+
- lib/thrift/server/simple_server.rb
|
147
|
+
- lib/thrift/server/thin_http_server.rb
|
148
|
+
- lib/thrift/server/thread_pool_server.rb
|
149
|
+
- lib/thrift/server/threaded_server.rb
|
150
|
+
- lib/thrift/struct.rb
|
151
|
+
- lib/thrift/struct_union.rb
|
152
|
+
- lib/thrift/thrift_native.rb
|
153
|
+
- lib/thrift/transport/base_server_transport.rb
|
154
|
+
- lib/thrift/transport/base_transport.rb
|
155
|
+
- lib/thrift/transport/buffered_transport.rb
|
156
|
+
- lib/thrift/transport/framed_transport.rb
|
157
|
+
- lib/thrift/transport/http_client_transport.rb
|
158
|
+
- lib/thrift/transport/io_stream_transport.rb
|
159
|
+
- lib/thrift/transport/memory_buffer_transport.rb
|
160
|
+
- lib/thrift/transport/server_socket.rb
|
161
|
+
- lib/thrift/transport/socket.rb
|
162
|
+
- lib/thrift/transport/unix_server_socket.rb
|
163
|
+
- lib/thrift/transport/unix_socket.rb
|
164
|
+
- lib/thrift/types/known/any.rb
|
165
|
+
- lib/thrift/types/known/any_constants.rb
|
166
|
+
- lib/thrift/types/known/any_types.rb
|
167
|
+
- lib/thrift/types/known/duration.rb
|
168
|
+
- lib/thrift/types/known/duration_constants.rb
|
169
|
+
- lib/thrift/types/known/duration_types.rb
|
170
|
+
- lib/thrift/types/known/timestamp.rb
|
171
|
+
- lib/thrift/types/known/timestamp_constants.rb
|
172
|
+
- lib/thrift/types/known/timestamp_types.rb
|
173
|
+
- lib/thrift/types/value.rb
|
174
|
+
- lib/thrift/types/value_constants.rb
|
175
|
+
- lib/thrift/types/value_types.rb
|
176
176
|
- lib/thrift/types.rb
|
177
|
-
- lib/thrift/
|
178
|
-
- lib/thrift
|
177
|
+
- lib/thrift/union.rb
|
178
|
+
- lib/thrift.rb
|
179
179
|
files:
|
180
180
|
- README.md
|
181
181
|
- benchmark/Benchmark.thrift
|
182
182
|
- benchmark/benchmark.rb
|
183
183
|
- benchmark/client.rb
|
184
|
-
- benchmark/gen-rb/benchmark_constants.rb
|
185
|
-
- benchmark/gen-rb/benchmark_service.rb
|
186
|
-
- benchmark/gen-rb/benchmark_types.rb
|
187
184
|
- benchmark/server.rb
|
188
185
|
- benchmark/thin_server.rb
|
189
186
|
- ext/binary_protocol_accelerated.c
|
@@ -209,8 +206,10 @@ files:
|
|
209
206
|
- lib/thrift/client.rb
|
210
207
|
- lib/thrift/core_ext.rb
|
211
208
|
- lib/thrift/core_ext/fixnum.rb
|
209
|
+
- lib/thrift/definition.rb
|
212
210
|
- lib/thrift/exceptions.rb
|
213
211
|
- lib/thrift/metrics.rb
|
212
|
+
- lib/thrift/middleware.rb
|
214
213
|
- lib/thrift/multiplexed_processor.rb
|
215
214
|
- lib/thrift/processor.rb
|
216
215
|
- lib/thrift/protocol/base_protocol.rb
|
@@ -245,6 +244,18 @@ files:
|
|
245
244
|
- lib/thrift/transport/unix_server_socket.rb
|
246
245
|
- lib/thrift/transport/unix_socket.rb
|
247
246
|
- lib/thrift/types.rb
|
247
|
+
- lib/thrift/types/known/any.rb
|
248
|
+
- lib/thrift/types/known/any_constants.rb
|
249
|
+
- lib/thrift/types/known/any_types.rb
|
250
|
+
- lib/thrift/types/known/duration.rb
|
251
|
+
- lib/thrift/types/known/duration_constants.rb
|
252
|
+
- lib/thrift/types/known/duration_types.rb
|
253
|
+
- lib/thrift/types/known/timestamp.rb
|
254
|
+
- lib/thrift/types/known/timestamp_constants.rb
|
255
|
+
- lib/thrift/types/known/timestamp_types.rb
|
256
|
+
- lib/thrift/types/value.rb
|
257
|
+
- lib/thrift/types/value_constants.rb
|
258
|
+
- lib/thrift/types/value_types.rb
|
248
259
|
- lib/thrift/union.rb
|
249
260
|
- spec/BaseService.thrift
|
250
261
|
- spec/ExtendedService.thrift
|
@@ -261,25 +272,6 @@ files:
|
|
261
272
|
- spec/compact_protocol_spec.rb
|
262
273
|
- spec/exception_spec.rb
|
263
274
|
- spec/flat_spec.rb
|
264
|
-
- spec/gen-rb/base/base_service.rb
|
265
|
-
- spec/gen-rb/base/base_service_constants.rb
|
266
|
-
- spec/gen-rb/base/base_service_types.rb
|
267
|
-
- spec/gen-rb/extended/extended_service.rb
|
268
|
-
- spec/gen-rb/extended/extended_service_constants.rb
|
269
|
-
- spec/gen-rb/extended/extended_service_types.rb
|
270
|
-
- spec/gen-rb/flat/namespaced_nonblocking_service.rb
|
271
|
-
- spec/gen-rb/flat/referenced_constants.rb
|
272
|
-
- spec/gen-rb/flat/referenced_types.rb
|
273
|
-
- spec/gen-rb/flat/thrift_namespaced_spec_constants.rb
|
274
|
-
- spec/gen-rb/flat/thrift_namespaced_spec_types.rb
|
275
|
-
- spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb
|
276
|
-
- spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb
|
277
|
-
- spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb
|
278
|
-
- spec/gen-rb/nonblocking_service.rb
|
279
|
-
- spec/gen-rb/other_namespace/referenced_constants.rb
|
280
|
-
- spec/gen-rb/other_namespace/referenced_types.rb
|
281
|
-
- spec/gen-rb/thrift_spec_constants.rb
|
282
|
-
- spec/gen-rb/thrift_spec_types.rb
|
283
275
|
- spec/http_client_spec.rb
|
284
276
|
- spec/json_protocol_spec.rb
|
285
277
|
- spec/namespaced_spec.rb
|
@@ -295,21 +287,18 @@ files:
|
|
295
287
|
- spec/struct_nested_containers_spec.rb
|
296
288
|
- spec/struct_spec.rb
|
297
289
|
- spec/thin_http_server_spec.rb
|
290
|
+
- spec/types/known/any_spec.rb
|
291
|
+
- spec/types/known/duration_spec.rb
|
292
|
+
- spec/types/known/timestamp_spec.rb
|
293
|
+
- spec/types/value_spec.rb
|
298
294
|
- spec/types_spec.rb
|
299
295
|
- spec/union_spec.rb
|
300
296
|
- spec/unix_socket_spec.rb
|
301
|
-
- test/debug_proto/gen-rb/debug_proto_test_constants.rb
|
302
|
-
- test/debug_proto/gen-rb/debug_proto_test_types.rb
|
303
|
-
- test/debug_proto/gen-rb/empty_service.rb
|
304
|
-
- test/debug_proto/gen-rb/inherited.rb
|
305
|
-
- test/debug_proto/gen-rb/reverse_order_service.rb
|
306
|
-
- test/debug_proto/gen-rb/service_for_exception_with_a_map.rb
|
307
|
-
- test/debug_proto/gen-rb/srv.rb
|
308
297
|
homepage: http://thrift.apache.org
|
309
298
|
licenses:
|
310
299
|
- Apache 2.0
|
311
300
|
metadata: {}
|
312
|
-
post_install_message:
|
301
|
+
post_install_message:
|
313
302
|
rdoc_options:
|
314
303
|
- "--line-numbers"
|
315
304
|
- "--inline-source"
|
@@ -331,75 +320,50 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
320
|
- !ruby/object:Gem::Version
|
332
321
|
version: '0'
|
333
322
|
requirements: []
|
334
|
-
rubygems_version: 3.
|
335
|
-
signing_key:
|
323
|
+
rubygems_version: 3.2.32
|
324
|
+
signing_key:
|
336
325
|
specification_version: 4
|
337
326
|
summary: Ruby bindings for Apache Thrift
|
338
327
|
test_files:
|
339
|
-
- test/debug_proto/gen-rb/debug_proto_test_constants.rb
|
340
|
-
- test/debug_proto/gen-rb/debug_proto_test_types.rb
|
341
|
-
- test/debug_proto/gen-rb/service_for_exception_with_a_map.rb
|
342
|
-
- test/debug_proto/gen-rb/inherited.rb
|
343
|
-
- test/debug_proto/gen-rb/reverse_order_service.rb
|
344
|
-
- test/debug_proto/gen-rb/empty_service.rb
|
345
|
-
- test/debug_proto/gen-rb/srv.rb
|
346
|
-
- spec/ThriftSpec.thrift
|
347
|
-
- spec/struct_nested_containers_spec.rb
|
348
|
-
- spec/http_client_spec.rb
|
349
|
-
- spec/thin_http_server_spec.rb
|
350
|
-
- spec/spec_helper.rb
|
351
|
-
- spec/rack_application_spec.rb
|
352
|
-
- spec/compact_protocol_spec.rb
|
353
|
-
- spec/base_protocol_spec.rb
|
354
|
-
- spec/client_spec.rb
|
355
|
-
- spec/server_spec.rb
|
356
|
-
- spec/server_socket_spec.rb
|
357
|
-
- spec/bytes_spec.rb
|
358
328
|
- spec/BaseService.thrift
|
359
|
-
- spec/
|
360
|
-
- spec/json_protocol_spec.rb
|
329
|
+
- spec/ExtendedService.thrift
|
361
330
|
- spec/Referenced.thrift
|
362
|
-
- spec/
|
331
|
+
- spec/ThriftNamespacedSpec.thrift
|
332
|
+
- spec/ThriftSpec.thrift
|
333
|
+
- spec/base_protocol_spec.rb
|
334
|
+
- spec/base_transport_spec.rb
|
363
335
|
- spec/binary_protocol_accelerated_spec.rb
|
364
|
-
- spec/
|
365
|
-
- spec/
|
366
|
-
- spec/
|
367
|
-
- spec/
|
368
|
-
- spec/
|
369
|
-
- spec/gen-rb/flat/referenced_constants.rb
|
370
|
-
- spec/gen-rb/flat/referenced_types.rb
|
371
|
-
- spec/gen-rb/flat/thrift_namespaced_spec_types.rb
|
372
|
-
- spec/gen-rb/other_namespace/referenced_constants.rb
|
373
|
-
- spec/gen-rb/other_namespace/referenced_types.rb
|
374
|
-
- spec/gen-rb/extended/extended_service.rb
|
375
|
-
- spec/gen-rb/extended/extended_service_types.rb
|
376
|
-
- spec/gen-rb/extended/extended_service_constants.rb
|
377
|
-
- spec/gen-rb/thrift_spec_constants.rb
|
378
|
-
- spec/gen-rb/nonblocking_service.rb
|
379
|
-
- spec/gen-rb/thrift_spec_types.rb
|
380
|
-
- spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb
|
381
|
-
- spec/gen-rb/namespaced_spec_namespace/namespaced_nonblocking_service.rb
|
382
|
-
- spec/gen-rb/namespaced_spec_namespace/thrift_namespaced_spec_types.rb
|
383
|
-
- spec/gen-rb/base/base_service.rb
|
384
|
-
- spec/gen-rb/base/base_service_constants.rb
|
385
|
-
- spec/gen-rb/base/base_service_types.rb
|
336
|
+
- spec/binary_protocol_spec.rb
|
337
|
+
- spec/binary_protocol_spec_shared.rb
|
338
|
+
- spec/bytes_spec.rb
|
339
|
+
- spec/client_spec.rb
|
340
|
+
- spec/compact_protocol_spec.rb
|
386
341
|
- spec/exception_spec.rb
|
387
|
-
- spec/
|
388
|
-
- spec/
|
389
|
-
- spec/
|
342
|
+
- spec/flat_spec.rb
|
343
|
+
- spec/http_client_spec.rb
|
344
|
+
- spec/json_protocol_spec.rb
|
390
345
|
- spec/namespaced_spec.rb
|
346
|
+
- spec/nonblocking_server_spec.rb
|
347
|
+
- spec/processor_spec.rb
|
348
|
+
- spec/rack_application_spec.rb
|
391
349
|
- spec/serializer_spec.rb
|
350
|
+
- spec/server_socket_spec.rb
|
351
|
+
- spec/server_spec.rb
|
352
|
+
- spec/socket_spec.rb
|
392
353
|
- spec/socket_spec_shared.rb
|
393
|
-
- spec/
|
394
|
-
- spec/
|
395
|
-
- spec/
|
396
|
-
- spec/
|
397
|
-
- spec/
|
354
|
+
- spec/spec_helper.rb
|
355
|
+
- spec/struct_nested_containers_spec.rb
|
356
|
+
- spec/struct_spec.rb
|
357
|
+
- spec/thin_http_server_spec.rb
|
358
|
+
- spec/types/known/any_spec.rb
|
359
|
+
- spec/types/known/duration_spec.rb
|
360
|
+
- spec/types/known/timestamp_spec.rb
|
361
|
+
- spec/types/value_spec.rb
|
362
|
+
- spec/types_spec.rb
|
363
|
+
- spec/union_spec.rb
|
364
|
+
- spec/unix_socket_spec.rb
|
398
365
|
- benchmark/Benchmark.thrift
|
399
|
-
- benchmark/gen-rb/benchmark_service.rb
|
400
|
-
- benchmark/gen-rb/benchmark_constants.rb
|
401
|
-
- benchmark/gen-rb/benchmark_types.rb
|
402
|
-
- benchmark/client.rb
|
403
366
|
- benchmark/benchmark.rb
|
404
|
-
- benchmark/
|
367
|
+
- benchmark/client.rb
|
405
368
|
- benchmark/server.rb
|
369
|
+
- benchmark/thin_server.rb
|
@@ -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 'benchmark_types'
|
9
|
-
|
10
|
-
module ThriftBenchmark
|
11
|
-
module BenchmarkService
|
12
|
-
SERVICE_NAME = "BenchmarkService"
|
13
|
-
PROGRAM_NAME = ""
|
14
|
-
|
15
|
-
class Client
|
16
|
-
include ::Thrift::Client
|
17
|
-
|
18
|
-
def self.from_provider(provider)
|
19
|
-
Client.new(*provider.build(", BenchmarkService"))
|
20
|
-
end
|
21
|
-
|
22
|
-
def fibonacci(ctx, n)
|
23
|
-
@middleware.handle_binary(ctx, 'fibonacci', Fibonacci_args.new(:n => n)) do |ctx, args|
|
24
|
-
send_fibonacci(ctx, args.n)
|
25
|
-
return recv_fibonacci(ctx)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def send_fibonacci(ctx, n)
|
30
|
-
send_message('fibonacci', Fibonacci_args, :n => n)
|
31
|
-
end
|
32
|
-
|
33
|
-
def recv_fibonacci(ctx)
|
34
|
-
result = receive_message(Fibonacci_result)
|
35
|
-
return result.success unless result.success.nil?
|
36
|
-
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'fibonacci failed: unknown result')
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
class Processor
|
42
|
-
include ::Thrift::Processor
|
43
|
-
|
44
|
-
def process_fibonacci(ctx, seqid, iprot, oprot)
|
45
|
-
args = read_args(iprot, Fibonacci_args)
|
46
|
-
@middleware.handle_binary(ctx, 'fibonacci', args) do |ctx, args|
|
47
|
-
result = Fibonacci_result.new()
|
48
|
-
result.success = @handler.fibonacci(ctx, args.n)
|
49
|
-
write_result(result, oprot, 'fibonacci', seqid)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
# HELPER FUNCTIONS AND STRUCTURES
|
56
|
-
|
57
|
-
class Fibonacci_args
|
58
|
-
include ::Thrift::Struct, ::Thrift::Struct_Union
|
59
|
-
N = 1
|
60
|
-
|
61
|
-
FIELDS = {
|
62
|
-
N => {:type => ::Thrift::Types::BYTE, :name => 'n'}
|
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 Fibonacci_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
|
-
|
91
|
-
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,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
|