upfluence-thrift 2.6.8 → 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 (167) hide show
  1. checksums.yaml +4 -4
  2. data/benchmark/{gen-rb/benchmark_constants.rb → benchmark_constants.rb} +1 -1
  3. data/benchmark/{gen-rb/benchmark_service.rb → benchmark_service.rb} +2 -2
  4. data/benchmark/{gen-rb/benchmark_types.rb → benchmark_types.rb} +1 -1
  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/inbound_stream.rb +72 -0
  10. data/lib/thrift/middleware.rb +42 -0
  11. data/lib/thrift/outbound_stream.rb +52 -0
  12. data/lib/thrift/processor.rb +287 -47
  13. data/lib/thrift/protocol/base_protocol.rb +35 -33
  14. data/lib/thrift/protocol/binary_protocol.rb +8 -1
  15. data/lib/thrift/protocol/binary_protocol_accelerated.rb +8 -0
  16. data/lib/thrift/protocol/compact_protocol.rb +8 -0
  17. data/lib/thrift/protocol/json_protocol.rb +21 -4
  18. data/lib/thrift/protocol/multiplexed_protocol.rb +5 -1
  19. data/lib/thrift/server/base_server.rb +8 -2
  20. data/lib/thrift/server/nonblocking_server.rb +5 -4
  21. data/lib/thrift/server/simple_server.rb +5 -1
  22. data/lib/thrift/server/thread_pool_server.rb +5 -1
  23. data/lib/thrift/server/threaded_server.rb +5 -1
  24. data/lib/thrift/transport/base_server_transport.rb +1 -1
  25. data/lib/thrift/transport/base_transport.rb +8 -0
  26. data/lib/thrift/transport/buffered_transport.rb +9 -1
  27. data/lib/thrift/transport/framed_transport.rb +9 -1
  28. data/lib/thrift/transport/http_client_transport.rb +4 -0
  29. data/lib/thrift/transport/io_stream_transport.rb +4 -1
  30. data/lib/thrift/transport/memory_buffer_transport.rb +4 -0
  31. data/lib/thrift/transport/server_socket.rb +5 -0
  32. data/lib/thrift/transport/socket.rb +21 -17
  33. data/lib/thrift/transport/ssl_server_socket.rb +41 -0
  34. data/lib/thrift/transport/ssl_socket.rb +51 -0
  35. data/lib/thrift/transport/unix_server_socket.rb +5 -1
  36. data/lib/thrift/transport/unix_socket.rb +5 -1
  37. data/lib/thrift/types/annotation/deprecation/deprecation_constants.rb +1 -1
  38. data/lib/thrift/types/annotation/deprecation/deprecation_types.rb +2 -2
  39. data/lib/thrift/types/annotation/exception/exception_constants.rb +17 -0
  40. data/lib/thrift/types/annotation/exception/exception_types.rb +44 -0
  41. data/lib/thrift/types/annotation/naming/naming_constants.rb +1 -1
  42. data/lib/thrift/types/annotation/naming/naming_types.rb +2 -2
  43. data/lib/thrift/types/annotation/rpc/rpc_constants.rb +17 -0
  44. data/lib/thrift/types/annotation/rpc/rpc_types.rb +74 -0
  45. data/lib/thrift/types/annotation_definition/annotation_definition_constants.rb +15 -0
  46. data/lib/thrift/types/annotation_definition/annotation_definition_types.rb +116 -0
  47. data/lib/thrift/types/constant_definition/constant_definition_constants.rb +15 -0
  48. data/lib/thrift/types/constant_definition/constant_definition_types.rb +292 -0
  49. data/lib/thrift/types/core/core_constants.rb +15 -0
  50. data/lib/thrift/types/core/core_types.rb +58 -0
  51. data/lib/thrift/types/enum_definition/enum_definition_constants.rb +15 -0
  52. data/lib/thrift/types/enum_definition/enum_definition_types.rb +106 -0
  53. data/lib/thrift/types/known/any/any_constants.rb +1 -1
  54. data/lib/thrift/types/known/any/any_types.rb +2 -2
  55. data/lib/thrift/types/known/duration/duration_constants.rb +1 -1
  56. data/lib/thrift/types/known/duration/duration_types.rb +2 -2
  57. data/lib/thrift/types/known/timestamp/timestamp_constants.rb +1 -1
  58. data/lib/thrift/types/known/timestamp/timestamp_types.rb +2 -2
  59. data/lib/thrift/types/plugin/plugin.rb +139 -0
  60. data/lib/thrift/types/plugin/plugin_constants.rb +15 -0
  61. data/lib/thrift/types/plugin/plugin_types.rb +106 -0
  62. data/lib/thrift/types/program_definition/program_definition_constants.rb +15 -0
  63. data/lib/thrift/types/program_definition/program_definition_types.rb +137 -0
  64. data/lib/thrift/types/service_definition/service_definition_constants.rb +15 -0
  65. data/lib/thrift/types/service_definition/service_definition_types.rb +160 -0
  66. data/lib/thrift/types/struct_definition/struct_definition_constants.rb +15 -0
  67. data/lib/thrift/types/struct_definition/struct_definition_types.rb +157 -0
  68. data/lib/thrift/types/type_definition/type_definition_constants.rb +15 -0
  69. data/lib/thrift/types/type_definition/type_definition_types.rb +242 -0
  70. data/lib/thrift/types/value/value_constants.rb +1 -1
  71. data/lib/thrift/types/value/value_types.rb +50 -51
  72. data/lib/thrift/types.rb +11 -3
  73. data/lib/thrift/union.rb +3 -6
  74. data/lib/thrift.rb +6 -0
  75. data/lib/types/annotation/deprecation/deprecation_constants.rb +16 -0
  76. data/lib/types/annotation/deprecation/deprecation_types.rb +42 -0
  77. data/lib/types/annotation/naming/naming_constants.rb +16 -0
  78. data/lib/types/annotation/naming/naming_types.rb +57 -0
  79. data/lib/types/annotation_definition/annotation_definition_constants.rb +14 -0
  80. data/lib/types/annotation_definition/annotation_definition_types.rb +114 -0
  81. data/lib/types/constant_definition/constant_definition_constants.rb +14 -0
  82. data/lib/types/constant_definition/constant_definition_types.rb +290 -0
  83. data/lib/types/core/core_constants.rb +14 -0
  84. data/lib/types/core/core_types.rb +56 -0
  85. data/lib/types/enum_definition/enum_definition_constants.rb +14 -0
  86. data/lib/types/enum_definition/enum_definition_types.rb +104 -0
  87. data/lib/types/known/any/any_constants.rb +16 -0
  88. data/lib/types/known/any/any_types.rb +59 -0
  89. data/lib/types/known/duration/duration_constants.rb +16 -0
  90. data/lib/types/known/duration/duration_types.rb +59 -0
  91. data/lib/types/known/timestamp/timestamp_constants.rb +16 -0
  92. data/lib/types/known/timestamp/timestamp_types.rb +59 -0
  93. data/lib/types/plugin/plugin.rb +137 -0
  94. data/lib/types/plugin/plugin_constants.rb +14 -0
  95. data/lib/types/plugin/plugin_types.rb +104 -0
  96. data/lib/types/program_definition/program_definition_constants.rb +14 -0
  97. data/lib/types/program_definition/program_definition_types.rb +135 -0
  98. data/lib/types/service_definition/service_definition_constants.rb +14 -0
  99. data/lib/types/service_definition/service_definition_types.rb +158 -0
  100. data/lib/types/struct_definition/struct_definition_constants.rb +14 -0
  101. data/lib/types/struct_definition/struct_definition_types.rb +155 -0
  102. data/lib/types/type_definition/type_definition_constants.rb +14 -0
  103. data/lib/types/type_definition/type_definition_types.rb +240 -0
  104. data/lib/types/value/value_constants.rb +14 -0
  105. data/lib/types/value/value_types.rb +330 -0
  106. data/spec/{gen-rb/base → base}/base_service.rb +2 -2
  107. data/spec/{gen-rb/base → base}/base_service_constants.rb +1 -1
  108. data/spec/{gen-rb/base → base}/base_service_types.rb +1 -1
  109. data/spec/base_protocol_spec.rb +79 -71
  110. data/spec/base_transport_spec.rb +155 -117
  111. data/spec/binary_protocol_accelerated_spec.rb +6 -2
  112. data/spec/binary_protocol_spec.rb +16 -8
  113. data/spec/binary_protocol_spec_shared.rb +77 -77
  114. data/spec/bytes_spec.rb +38 -38
  115. data/spec/client_spec.rb +48 -50
  116. data/spec/compact_protocol_spec.rb +59 -46
  117. data/spec/exception_spec.rb +54 -54
  118. data/spec/{gen-rb/extended → extended}/extended_service.rb +2 -2
  119. data/spec/{gen-rb/extended → extended}/extended_service_constants.rb +1 -1
  120. data/spec/{gen-rb/extended → extended}/extended_service_types.rb +1 -1
  121. data/spec/flat_spec.rb +5 -5
  122. data/spec/gen-rb/flat/namespaced_nonblocking_service.rb +4 -4
  123. data/spec/gen-rb/flat/referenced_constants.rb +1 -1
  124. data/spec/gen-rb/flat/referenced_types.rb +1 -1
  125. data/spec/gen-rb/flat/thrift_namespaced_spec_constants.rb +1 -1
  126. data/spec/gen-rb/flat/thrift_namespaced_spec_types.rb +1 -1
  127. data/spec/http_client_spec.rb +96 -43
  128. data/spec/json_protocol_spec.rb +170 -131
  129. data/spec/namespaced_spec.rb +24 -27
  130. data/spec/{gen-rb/namespaced_spec_namespace → namespaced_spec_namespace}/namespaced_nonblocking_service.rb +4 -4
  131. data/spec/{gen-rb/namespaced_spec_namespace → namespaced_spec_namespace}/thrift_namespaced_spec_constants.rb +1 -1
  132. data/spec/{gen-rb/namespaced_spec_namespace → namespaced_spec_namespace}/thrift_namespaced_spec_types.rb +1 -1
  133. data/spec/nonblocking_server_spec.rb +16 -16
  134. data/spec/{gen-rb/nonblocking_service.rb → nonblocking_service.rb} +4 -4
  135. data/spec/{gen-rb/other_namespace → other_namespace}/referenced_constants.rb +1 -1
  136. data/spec/{gen-rb/other_namespace → other_namespace}/referenced_types.rb +1 -1
  137. data/spec/processor_spec.rb +42 -31
  138. data/spec/rack_application_spec.rb +22 -26
  139. data/spec/serializer_spec.rb +20 -20
  140. data/spec/server_socket_spec.rb +27 -22
  141. data/spec/server_spec.rb +91 -51
  142. data/spec/socket_spec.rb +23 -16
  143. data/spec/socket_spec_shared.rb +31 -31
  144. data/spec/spec_helper.rb +1 -1
  145. data/spec/ssl_server_socket_spec.rb +34 -0
  146. data/spec/ssl_socket_spec.rb +78 -0
  147. data/spec/streaming_spec.rb +442 -0
  148. data/spec/struct_nested_containers_spec.rb +24 -24
  149. data/spec/struct_spec.rb +120 -120
  150. data/spec/thin_http_server_spec.rb +71 -28
  151. data/spec/{gen-rb/thrift_spec_constants.rb → thrift_spec_constants.rb} +1 -1
  152. data/spec/{gen-rb/thrift_spec_types.rb → thrift_spec_types.rb} +16 -16
  153. data/spec/types/known/any_spec.rb +2 -2
  154. data/spec/types/known/duration_spec.rb +1 -1
  155. data/spec/types/known/timestamp_spec.rb +1 -1
  156. data/spec/types/value_spec.rb +2 -1
  157. data/spec/types_spec.rb +56 -53
  158. data/spec/union_spec.rb +51 -40
  159. data/spec/unix_socket_spec.rb +43 -34
  160. data/test/debug_proto/gen-rb/debug_proto_test_constants.rb +267 -260
  161. data/test/debug_proto/gen-rb/debug_proto_test_types.rb +1481 -1416
  162. data/test/debug_proto/gen-rb/empty_service.rb +31 -27
  163. data/test/debug_proto/gen-rb/inherited.rb +102 -98
  164. data/test/debug_proto/gen-rb/reverse_order_service.rb +112 -108
  165. data/test/debug_proto/gen-rb/service_for_exception_with_a_map.rb +99 -95
  166. data/test/debug_proto/gen-rb/srv.rb +525 -406
  167. metadata +178 -41
@@ -1,5 +1,5 @@
1
1
  #
2
- # Autogenerated by Thrift Compiler ()
2
+ # Autogenerated by Thrift Compiler (v0.0.1-upfluence)
3
3
  #
4
4
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
5
  #
@@ -7,140 +7,144 @@
7
7
  require 'thrift'
8
8
  require 'debug_proto_test_types'
9
9
 
10
- module ServiceForExceptionWithAMap
11
- SERVICE = 'ServiceForExceptionWithAMap'.freeze
12
- NAMESPACE = ''.freeze
10
+ module Thrift
11
+ module Test
12
+ module ServiceForExceptionWithAMap
13
+ SERVICE = 'ServiceForExceptionWithAMap'.freeze
14
+ NAMESPACE = ''.freeze
13
15
 
14
- LEGACY_ANNOTATIONS = {
15
- }.freeze
16
+ LEGACY_ANNOTATIONS = {
17
+ }.freeze
16
18
 
17
- STRUCTURED_ANNOTATIONS = [
18
- ].freeze
19
+ STRUCTURED_ANNOTATIONS = [
20
+ ].freeze
19
21
 
20
- # HELPER FUNCTIONS AND STRUCTURES
22
+ # HELPER FUNCTIONS AND STRUCTURES
21
23
 
22
- class MethodThatThrowsAnException_args
23
- include ::Thrift::Struct, ::Thrift::Struct_Union
24
+ class MethodThatThrowsAnException_args
25
+ include ::Thrift::Struct, ::Thrift::Struct_Union
24
26
 
25
- NAME = 'methodThatThrowsAnException_args'.freeze
26
- NAMESPACE = ''.freeze
27
+ NAME = 'methodThatThrowsAnException_args'.freeze
28
+ NAMESPACE = ''.freeze
27
29
 
28
- LEGACY_ANNOTATIONS = {
29
- }.freeze
30
+ LEGACY_ANNOTATIONS = {
31
+ }.freeze
30
32
 
31
- STRUCTURED_ANNOTATIONS = [
32
- ].freeze
33
+ STRUCTURED_ANNOTATIONS = [
34
+ ].freeze
33
35
 
34
36
 
35
- FIELDS = {
37
+ FIELDS = {
36
38
 
37
- }
39
+ }
38
40
 
39
- def struct_fields; FIELDS; end
41
+ def struct_fields; FIELDS; end
40
42
 
41
- def validate
42
- end
43
+ def validate
44
+ end
43
45
 
44
- ::Thrift::Struct.generate_accessors self
45
- ::Thrift.register_struct_type self
46
- end
46
+ ::Thrift::Struct.generate_accessors self
47
+ ::Thrift.register_struct_type self
48
+ end
47
49
 
48
- class MethodThatThrowsAnException_result
49
- include ::Thrift::Struct, ::Thrift::Struct_Union
50
+ class MethodThatThrowsAnException_result
51
+ include ::Thrift::Struct, ::Thrift::Struct_Union
50
52
 
51
- NAME = 'methodThatThrowsAnException_result'.freeze
52
- NAMESPACE = ''.freeze
53
+ NAME = 'methodThatThrowsAnException_result'.freeze
54
+ NAMESPACE = ''.freeze
53
55
 
54
- LEGACY_ANNOTATIONS = {
55
- }.freeze
56
+ LEGACY_ANNOTATIONS = {
57
+ }.freeze
56
58
 
57
- STRUCTURED_ANNOTATIONS = [
58
- ].freeze
59
+ STRUCTURED_ANNOTATIONS = [
60
+ ].freeze
59
61
 
60
- THRIFT_FIELD_INDEX_XWAMAP = 1
62
+ THRIFT_FIELD_INDEX_XWAMAP = 1
61
63
 
62
- THRIFT_FIELD_XWAMAP_LEGACY_ANNOTATIONS = {
63
- }.freeze
64
+ THRIFT_FIELD_XWAMAP_LEGACY_ANNOTATIONS = {
65
+ }.freeze
64
66
 
65
- THRIFT_FIELD_XWAMAP_STRUCTURED_ANNOTATIONS = [
66
- ].freeze
67
+ THRIFT_FIELD_XWAMAP_STRUCTURED_ANNOTATIONS = [
68
+ ].freeze
67
69
 
68
- FIELDS = {
69
- THRIFT_FIELD_INDEX_XWAMAP => {type: ::Thrift::Types::STRUCT, name: 'xwamap', class: ::ExceptionWithAMap, legacy_annotations: THRIFT_FIELD_XWAMAP_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_XWAMAP_STRUCTURED_ANNOTATIONS}
70
- }
70
+ FIELDS = {
71
+ THRIFT_FIELD_INDEX_XWAMAP => {type: ::Thrift::Types::STRUCT, name: 'xwamap', class: ::Thrift::Test::ExceptionWithAMap, legacy_annotations: THRIFT_FIELD_XWAMAP_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_XWAMAP_STRUCTURED_ANNOTATIONS}
72
+ }
71
73
 
72
- def struct_fields; FIELDS; end
74
+ def struct_fields; FIELDS; end
73
75
 
74
- def validate
75
- end
76
+ def validate
77
+ end
76
78
 
77
- ::Thrift::Struct.generate_accessors self
78
- ::Thrift.register_struct_type self
79
- end
79
+ ::Thrift::Struct.generate_accessors self
80
+ ::Thrift.register_struct_type self
81
+ end
80
82
 
81
- class Client
82
- def initialize(client)
83
- @client = ::Thrift.build_client(client)
84
- end
83
+ class Client
84
+ def initialize(client)
85
+ @client = ::Thrift.build_client(client)
86
+ end
85
87
 
86
- def self.from_provider(provider)
87
- Client.new(provider.build(NAMESPACE, SERVICE))
88
- end
88
+ def self.from_provider(provider)
89
+ Client.new(provider.build(NAMESPACE, SERVICE))
90
+ end
89
91
 
90
- def methodThatThrowsAnException()
91
- result = @client.call_binary(
92
- 'methodThatThrowsAnException',
93
- MethodThatThrowsAnException_args.new(),
94
- MethodThatThrowsAnException_result
95
- )
92
+ def methodThatThrowsAnException()
93
+ result = @client.call_binary(
94
+ 'methodThatThrowsAnException',
95
+ MethodThatThrowsAnException_args.new(),
96
+ MethodThatThrowsAnException_result
97
+ )
96
98
 
97
- raise result.xwamap unless result.xwamap.nil?
98
- nil
99
- end
99
+ raise result.xwamap unless result.xwamap.nil?
100
+ nil
101
+ end
100
102
 
101
- end
103
+ end
102
104
 
103
- class Processor
104
- include ::Thrift::Processor
105
+ class Processor
106
+ include ::Thrift::Processor
105
107
 
106
- def self.from_provider(handler, provider)
107
- provider.build(NAMESPACE, SERVICE, Processor, handler)
108
- end
108
+ def self.from_provider(handler, provider)
109
+ provider.build(NAMESPACE, SERVICE, Processor, handler)
110
+ end
109
111
 
110
- THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_LEGACY_ANNOTATIONS = {
111
- }.freeze
112
+ THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_LEGACY_ANNOTATIONS = {
113
+ }.freeze
112
114
 
113
- THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS = [
114
- ].freeze
115
+ THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS = [
116
+ ].freeze
115
117
 
116
- METHODS = {
117
- 'methodThatThrowsAnException' => { args_klass: MethodThatThrowsAnException_args, oneway: false, legacy_annotations: THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS, structured_annotations: THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS},
118
- }.freeze
118
+ METHODS = {
119
+ 'methodThatThrowsAnException' => { args_klass: MethodThatThrowsAnException_args, result_klass: MethodThatThrowsAnException_result, oneway: false, legacy_annotations: THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS, structured_annotations: THRIFT_METHOD_METHODTHATTHROWSANEXCEPTION_STRUCTURED_ANNOTATIONS},
120
+ }.freeze
119
121
 
120
- def execute_methodThatThrowsAnException(args)
121
- result = MethodThatThrowsAnException_result.new()
122
+ def execute_methodThatThrowsAnException(args)
123
+ result = MethodThatThrowsAnException_result.new()
122
124
 
123
- begin
124
- @handler.methodThatThrowsAnException()
125
- rescue ::ExceptionWithAMap => xwamap
126
- result.xwamap = xwamap
127
- end
128
-
129
- result
130
- end
125
+ begin
126
+ @handler.methodThatThrowsAnException()
127
+ rescue ::Thrift::Test::ExceptionWithAMap => xwamap
128
+ result.xwamap = xwamap
129
+ end
130
+
131
+ result
132
+ end
133
+
134
+ def process_methodThatThrowsAnException(seqid, iprot, oprot)
135
+ args = read_args(iprot, MethodThatThrowsAnException_args)
136
+ result = @middleware.handle_binary('methodThatThrowsAnException', args) do |args|
137
+ execute_methodThatThrowsAnException(args)
138
+ end
139
+
140
+ write_result(result, oprot, 'methodThatThrowsAnException', seqid)
141
+ end
131
142
 
132
- def process_methodThatThrowsAnException(seqid, iprot, oprot)
133
- args = read_args(iprot, MethodThatThrowsAnException_args)
134
- result = @middleware.handle_binary('methodThatThrowsAnException', args) do |args|
135
- execute_methodThatThrowsAnException(args)
136
143
  end
137
144
 
138
- write_result(result, oprot, 'methodThatThrowsAnException', seqid)
145
+ ::Thrift.register_service_type(self)
146
+
139
147
  end
140
148
 
141
149
  end
142
-
143
- ::Thrift.register_service_type(self)
144
-
145
150
  end
146
-