upfluence-thrift 2.6.1 → 2.7.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.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/benchmark/benchmark_constants.rb +11 -0
  3. data/benchmark/benchmark_service.rb +152 -0
  4. data/benchmark/benchmark_types.rb +10 -0
  5. data/ext/struct.c +5 -1
  6. data/lib/thrift/base_stream.rb +85 -0
  7. data/lib/thrift/bidi_stream.rb +183 -0
  8. data/lib/thrift/client.rb +84 -17
  9. data/lib/thrift/definition.rb +4 -0
  10. data/lib/thrift/inbound_stream.rb +72 -0
  11. data/lib/thrift/middleware.rb +42 -0
  12. data/lib/thrift/outbound_stream.rb +52 -0
  13. data/lib/thrift/processor.rb +287 -47
  14. data/lib/thrift/protocol/base_protocol.rb +35 -33
  15. data/lib/thrift/protocol/binary_protocol.rb +8 -1
  16. data/lib/thrift/protocol/binary_protocol_accelerated.rb +8 -0
  17. data/lib/thrift/protocol/compact_protocol.rb +8 -0
  18. data/lib/thrift/protocol/json_protocol.rb +21 -4
  19. data/lib/thrift/protocol/multiplexed_protocol.rb +5 -1
  20. data/lib/thrift/server/base_server.rb +8 -2
  21. data/lib/thrift/server/nonblocking_server.rb +5 -4
  22. data/lib/thrift/server/simple_server.rb +5 -1
  23. data/lib/thrift/server/thread_pool_server.rb +5 -1
  24. data/lib/thrift/server/threaded_server.rb +5 -1
  25. data/lib/thrift/transport/base_server_transport.rb +1 -1
  26. data/lib/thrift/transport/base_transport.rb +8 -0
  27. data/lib/thrift/transport/buffered_transport.rb +9 -1
  28. data/lib/thrift/transport/framed_transport.rb +9 -1
  29. data/lib/thrift/transport/http_client_transport.rb +4 -0
  30. data/lib/thrift/transport/io_stream_transport.rb +4 -1
  31. data/lib/thrift/transport/memory_buffer_transport.rb +4 -0
  32. data/lib/thrift/transport/server_socket.rb +5 -0
  33. data/lib/thrift/transport/socket.rb +21 -17
  34. data/lib/thrift/transport/ssl_server_socket.rb +41 -0
  35. data/lib/thrift/transport/ssl_socket.rb +51 -0
  36. data/lib/thrift/transport/unix_server_socket.rb +5 -1
  37. data/lib/thrift/transport/unix_socket.rb +5 -1
  38. data/lib/thrift/types/annotation/deprecation/deprecation_constants.rb +1 -1
  39. data/lib/thrift/types/annotation/deprecation/deprecation_types.rb +2 -2
  40. data/lib/thrift/types/annotation/exception/exception_constants.rb +17 -0
  41. data/lib/thrift/types/annotation/exception/exception_types.rb +44 -0
  42. data/lib/thrift/types/annotation/naming/naming_constants.rb +1 -1
  43. data/lib/thrift/types/annotation/naming/naming_types.rb +2 -2
  44. data/lib/thrift/types/annotation/rpc/rpc_constants.rb +17 -0
  45. data/lib/thrift/types/annotation/rpc/rpc_types.rb +74 -0
  46. data/lib/thrift/types/annotation_definition/annotation_definition_constants.rb +15 -0
  47. data/lib/thrift/types/annotation_definition/annotation_definition_types.rb +116 -0
  48. data/lib/thrift/types/constant_definition/constant_definition_constants.rb +15 -0
  49. data/lib/thrift/types/constant_definition/constant_definition_types.rb +292 -0
  50. data/lib/thrift/types/core/core_constants.rb +15 -0
  51. data/lib/thrift/types/core/core_types.rb +58 -0
  52. data/lib/thrift/types/enum_definition/enum_definition_constants.rb +15 -0
  53. data/lib/thrift/types/enum_definition/enum_definition_types.rb +106 -0
  54. data/lib/thrift/types/known/any/any_constants.rb +1 -1
  55. data/lib/thrift/types/known/any/any_types.rb +2 -2
  56. data/lib/thrift/types/known/duration/duration_constants.rb +1 -1
  57. data/lib/thrift/types/known/duration/duration_types.rb +2 -2
  58. data/lib/thrift/types/known/timestamp/timestamp_constants.rb +1 -1
  59. data/lib/thrift/types/known/timestamp/timestamp_types.rb +2 -2
  60. data/lib/thrift/types/plugin/plugin.rb +139 -0
  61. data/lib/thrift/types/plugin/plugin_constants.rb +15 -0
  62. data/lib/thrift/types/plugin/plugin_types.rb +106 -0
  63. data/lib/thrift/types/program_definition/program_definition_constants.rb +15 -0
  64. data/lib/thrift/types/program_definition/program_definition_types.rb +137 -0
  65. data/lib/thrift/types/service_definition/service_definition_constants.rb +15 -0
  66. data/lib/thrift/types/service_definition/service_definition_types.rb +160 -0
  67. data/lib/thrift/types/struct_definition/struct_definition_constants.rb +15 -0
  68. data/lib/thrift/types/struct_definition/struct_definition_types.rb +157 -0
  69. data/lib/thrift/types/type_definition/type_definition_constants.rb +15 -0
  70. data/lib/thrift/types/type_definition/type_definition_types.rb +242 -0
  71. data/lib/thrift/types/value/value_constants.rb +1 -1
  72. data/lib/thrift/types/value/value_types.rb +50 -51
  73. data/lib/thrift/types.rb +11 -3
  74. data/lib/thrift/union.rb +3 -6
  75. data/lib/thrift.rb +6 -0
  76. data/lib/types/annotation/deprecation/deprecation_constants.rb +16 -0
  77. data/lib/types/annotation/deprecation/deprecation_types.rb +42 -0
  78. data/lib/types/annotation/naming/naming_constants.rb +16 -0
  79. data/lib/types/annotation/naming/naming_types.rb +57 -0
  80. data/lib/types/annotation_definition/annotation_definition_constants.rb +14 -0
  81. data/lib/types/annotation_definition/annotation_definition_types.rb +114 -0
  82. data/lib/types/constant_definition/constant_definition_constants.rb +14 -0
  83. data/lib/types/constant_definition/constant_definition_types.rb +290 -0
  84. data/lib/types/core/core_constants.rb +14 -0
  85. data/lib/types/core/core_types.rb +56 -0
  86. data/lib/types/enum_definition/enum_definition_constants.rb +14 -0
  87. data/lib/types/enum_definition/enum_definition_types.rb +104 -0
  88. data/lib/types/known/any/any_constants.rb +16 -0
  89. data/lib/types/known/any/any_types.rb +59 -0
  90. data/lib/types/known/duration/duration_constants.rb +16 -0
  91. data/lib/types/known/duration/duration_types.rb +59 -0
  92. data/lib/types/known/timestamp/timestamp_constants.rb +16 -0
  93. data/lib/types/known/timestamp/timestamp_types.rb +59 -0
  94. data/lib/types/plugin/plugin.rb +137 -0
  95. data/lib/types/plugin/plugin_constants.rb +14 -0
  96. data/lib/types/plugin/plugin_types.rb +104 -0
  97. data/lib/types/program_definition/program_definition_constants.rb +14 -0
  98. data/lib/types/program_definition/program_definition_types.rb +135 -0
  99. data/lib/types/service_definition/service_definition_constants.rb +14 -0
  100. data/lib/types/service_definition/service_definition_types.rb +158 -0
  101. data/lib/types/struct_definition/struct_definition_constants.rb +14 -0
  102. data/lib/types/struct_definition/struct_definition_types.rb +155 -0
  103. data/lib/types/type_definition/type_definition_constants.rb +14 -0
  104. data/lib/types/type_definition/type_definition_types.rb +240 -0
  105. data/lib/types/value/value_constants.rb +14 -0
  106. data/lib/types/value/value_types.rb +330 -0
  107. data/spec/base/base_service.rb +152 -0
  108. data/spec/base/base_service_constants.rb +11 -0
  109. data/spec/base/base_service_types.rb +45 -0
  110. data/spec/base_protocol_spec.rb +79 -71
  111. data/spec/base_transport_spec.rb +155 -117
  112. data/spec/binary_protocol_accelerated_spec.rb +6 -2
  113. data/spec/binary_protocol_spec.rb +16 -8
  114. data/spec/binary_protocol_spec_shared.rb +77 -77
  115. data/spec/bytes_spec.rb +38 -38
  116. data/spec/client_spec.rb +48 -50
  117. data/spec/compact_protocol_spec.rb +59 -46
  118. data/spec/exception_spec.rb +54 -54
  119. data/spec/extended/extended_service.rb +137 -0
  120. data/spec/extended/extended_service_constants.rb +11 -0
  121. data/spec/extended/extended_service_types.rb +12 -0
  122. data/spec/flat_spec.rb +5 -5
  123. data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +507 -0
  124. data/spec/gen-rb/flat/referenced_constants.rb +11 -0
  125. data/spec/gen-rb/flat/referenced_types.rb +17 -0
  126. data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +11 -0
  127. data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +47 -0
  128. data/spec/http_client_spec.rb +96 -43
  129. data/spec/json_protocol_spec.rb +170 -131
  130. data/spec/namespaced_spec.rb +24 -27
  131. data/spec/namespaced_spec_namespace/namespaced_nonblocking_service.rb +507 -0
  132. data/spec/namespaced_spec_namespace/thrift_namespaced_spec_constants.rb +11 -0
  133. data/spec/namespaced_spec_namespace/thrift_namespaced_spec_types.rb +47 -0
  134. data/spec/nonblocking_server_spec.rb +16 -16
  135. data/spec/nonblocking_service.rb +507 -0
  136. data/spec/other_namespace/referenced_constants.rb +11 -0
  137. data/spec/other_namespace/referenced_types.rb +17 -0
  138. data/spec/processor_spec.rb +42 -31
  139. data/spec/rack_application_spec.rb +22 -26
  140. data/spec/serializer_spec.rb +20 -20
  141. data/spec/server_socket_spec.rb +27 -22
  142. data/spec/server_spec.rb +91 -51
  143. data/spec/socket_spec.rb +23 -16
  144. data/spec/socket_spec_shared.rb +31 -31
  145. data/spec/spec_helper.rb +17 -17
  146. data/spec/ssl_server_socket_spec.rb +34 -0
  147. data/spec/ssl_socket_spec.rb +78 -0
  148. data/spec/streaming_spec.rb +442 -0
  149. data/spec/struct_nested_containers_spec.rb +24 -24
  150. data/spec/struct_spec.rb +120 -120
  151. data/spec/thin_http_server_spec.rb +71 -28
  152. data/spec/thrift_spec_constants.rb +11 -0
  153. data/spec/thrift_spec_types.rb +1173 -0
  154. data/spec/types/known/any_spec.rb +2 -2
  155. data/spec/types/known/duration_spec.rb +1 -1
  156. data/spec/types/known/timestamp_spec.rb +1 -1
  157. data/spec/types/value_spec.rb +2 -1
  158. data/spec/types_spec.rb +56 -53
  159. data/spec/union_spec.rb +51 -40
  160. data/spec/unix_socket_spec.rb +43 -34
  161. data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +281 -0
  162. data/test/debug_proto/gen-rb/debug_proto_test_types.rb +2033 -0
  163. data/test/debug_proto/gen-rb/empty_service.rb +52 -0
  164. data/test/debug_proto/gen-rb/inherited.rb +155 -0
  165. data/test/debug_proto/gen-rb/reverse_order_service.rb +169 -0
  166. data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +150 -0
  167. data/test/debug_proto/gen-rb/srv.rb +718 -0
  168. metadata +202 -7
@@ -0,0 +1,281 @@
1
+ #
2
+ # Autogenerated by Thrift Compiler (v0.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 Thrift
11
+ module Test
12
+ COMPACT_TEST = ::Thrift::Test::CompactProtoTestStruct.new({
13
+ %q"a_byte" => 127,
14
+ %q"a_double" => 5.6789,
15
+ %q"a_i16" => 32000,
16
+ %q"a_i32" => 1000000000,
17
+ %q"a_i64" => 1099511627775,
18
+ %q"a_string" => %q"my string",
19
+ %q"boolean_byte_map" => {
20
+ false => 0,
21
+ true => 1,
22
+ },
23
+ %q"boolean_list" => [
24
+ true,
25
+ true,
26
+ true,
27
+ false,
28
+ false,
29
+ false,
30
+ ],
31
+ %q"boolean_set" => Set.new([
32
+ true,
33
+ false,
34
+ ]),
35
+ %q"byte_boolean_map" => {
36
+ 1 => true,
37
+ 2 => false,
38
+ },
39
+ %q"byte_byte_map" => {
40
+ 1 => 2,
41
+ },
42
+ %q"byte_double_map" => {
43
+ 1 => 0.1,
44
+ 2 => -0.1,
45
+ 3 => 1e+06,
46
+ },
47
+ %q"byte_i16_map" => {
48
+ 1 => 1,
49
+ 2 => -1,
50
+ 3 => 32767,
51
+ },
52
+ %q"byte_i32_map" => {
53
+ 1 => 1,
54
+ 2 => -1,
55
+ 3 => 2147483647,
56
+ },
57
+ %q"byte_i64_map" => {
58
+ 1 => 1,
59
+ 2 => -1,
60
+ 3 => 9223372036854775807,
61
+ },
62
+ %q"byte_list" => [
63
+ -127,
64
+ -1,
65
+ 0,
66
+ 1,
67
+ 127,
68
+ ],
69
+ %q"byte_list_map" => {
70
+ 0 => [
71
+ ],
72
+ 1 => [
73
+ 1,
74
+ ],
75
+ 2 => [
76
+ 1,
77
+ 2,
78
+ ],
79
+ },
80
+ %q"byte_map_map" => {
81
+ 0 => {
82
+ },
83
+ 1 => {
84
+ 1 => 1,
85
+ },
86
+ 2 => {
87
+ 1 => 1,
88
+ 2 => 2,
89
+ },
90
+ },
91
+ %q"byte_set" => Set.new([
92
+ -127,
93
+ -1,
94
+ 0,
95
+ 1,
96
+ 127,
97
+ ]),
98
+ %q"byte_set_map" => {
99
+ 0 => Set.new([
100
+ ]),
101
+ 1 => Set.new([
102
+ 1,
103
+ ]),
104
+ 2 => Set.new([
105
+ 1,
106
+ 2,
107
+ ]),
108
+ },
109
+ %q"byte_string_map" => {
110
+ 1 => %q"",
111
+ 2 => %q"blah",
112
+ 3 => %q"loooooooooooooong string",
113
+ },
114
+ %q"double_byte_map" => {
115
+ -1.1 => 1,
116
+ 1.1 => 1,
117
+ },
118
+ %q"double_list" => [
119
+ 0.1,
120
+ 0.2,
121
+ 0.3,
122
+ ],
123
+ %q"double_set" => Set.new([
124
+ 0.1,
125
+ 0.2,
126
+ 0.3,
127
+ ]),
128
+ %q"empty_struct_field" => ::Thrift::Test::Empty.new({
129
+ }),
130
+ %q"false_field" => false,
131
+ %q"field20000" => 20000,
132
+ %q"field500" => 500,
133
+ %q"field5000" => 5000,
134
+ %q"i16_byte_map" => {
135
+ -1 => 1,
136
+ 1 => 1,
137
+ 32767 => 1,
138
+ },
139
+ %q"i16_list" => [
140
+ -1,
141
+ 0,
142
+ 1,
143
+ 32767,
144
+ ],
145
+ %q"i16_set" => Set.new([
146
+ -1,
147
+ 0,
148
+ 1,
149
+ 32767,
150
+ ]),
151
+ %q"i32_byte_map" => {
152
+ -1 => 1,
153
+ 1 => 1,
154
+ 2147483647 => 1,
155
+ },
156
+ %q"i32_list" => [
157
+ -1,
158
+ 0,
159
+ 255,
160
+ 65535,
161
+ 16777215,
162
+ 2147483647,
163
+ ],
164
+ %q"i32_set" => Set.new([
165
+ 1,
166
+ 2,
167
+ 3,
168
+ ]),
169
+ %q"i64_byte_map" => {
170
+ -1 => 1,
171
+ 0 => 1,
172
+ 1 => 1,
173
+ 9223372036854775807 => 1,
174
+ },
175
+ %q"i64_list" => [
176
+ -1,
177
+ 0,
178
+ 255,
179
+ 65535,
180
+ 16777215,
181
+ 4294967295,
182
+ 1099511627775,
183
+ 281474976710655,
184
+ 72057594037927935,
185
+ 9223372036854775807,
186
+ ],
187
+ %q"i64_set" => Set.new([
188
+ -1,
189
+ 0,
190
+ 255,
191
+ 65535,
192
+ 16777215,
193
+ 4294967295,
194
+ 1099511627775,
195
+ 281474976710655,
196
+ 72057594037927935,
197
+ 9223372036854775807,
198
+ ]),
199
+ %q"list_byte_map" => {
200
+ [
201
+ ] => 0,
202
+ [
203
+ 0,
204
+ 1,
205
+ ] => 2,
206
+ [
207
+ 1,
208
+ 2,
209
+ 3,
210
+ ] => 1,
211
+ },
212
+ %q"map_byte_map" => {
213
+ {
214
+ } => 0,
215
+ {
216
+ 1 => 1,
217
+ } => 1,
218
+ {
219
+ 2 => 2,
220
+ } => 2,
221
+ },
222
+ %q"set_byte_map" => {
223
+ Set.new([
224
+ ]) => 0,
225
+ Set.new([
226
+ 0,
227
+ 1,
228
+ ]) => 2,
229
+ Set.new([
230
+ 1,
231
+ 2,
232
+ 3,
233
+ ]) => 1,
234
+ },
235
+ %q"string_byte_map" => {
236
+ %q"" => 0,
237
+ %q"first" => 1,
238
+ %q"second" => 2,
239
+ %q"third" => 3,
240
+ },
241
+ %q"string_list" => [
242
+ %q"first",
243
+ %q"second",
244
+ %q"third",
245
+ ],
246
+ %q"string_set" => Set.new([
247
+ %q"first",
248
+ %q"second",
249
+ %q"third",
250
+ ]),
251
+ %q"struct_list" => [
252
+ ::Thrift::Test::Empty.new({
253
+ }),
254
+ ::Thrift::Test::Empty.new({
255
+ }),
256
+ ],
257
+ %q"struct_set" => Set.new([
258
+ ::Thrift::Test::Empty.new({
259
+ }),
260
+ ]),
261
+ %q"true_field" => true,
262
+ })
263
+
264
+ MYCONST = 2
265
+
266
+ MY_SOME_ENUM = 1
267
+
268
+ MY_SOME_ENUM_1 = 1
269
+
270
+ MY_ENUM_MAP = {
271
+ 1 => 2,
272
+ }
273
+
274
+ EXTRA_CRAZY_MAP = {
275
+ 1 => ::Thrift::Test::StructWithSomeEnum.new({
276
+ %q"blah" => 2,
277
+ }),
278
+ }
279
+
280
+ end
281
+ end