prepor-protobuf 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rubocop.yml +51 -0
  4. data/.rubocop_todo.yml +89 -0
  5. data/.travis.yml +25 -0
  6. data/.yardopts +5 -0
  7. data/CHANGES.md +256 -0
  8. data/CONTRIBUTING.md +16 -0
  9. data/Gemfile +3 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +33 -0
  12. data/Rakefile +64 -0
  13. data/bin/protoc-gen-ruby +16 -0
  14. data/bin/rpc_server +5 -0
  15. data/install-protobuf.sh +28 -0
  16. data/lib/protobuf.rb +100 -0
  17. data/lib/protobuf/cli.rb +242 -0
  18. data/lib/protobuf/code_generator.rb +44 -0
  19. data/lib/protobuf/decoder.rb +73 -0
  20. data/lib/protobuf/deprecation.rb +112 -0
  21. data/lib/protobuf/descriptors.rb +3 -0
  22. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +48 -0
  23. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +251 -0
  24. data/lib/protobuf/encoder.rb +67 -0
  25. data/lib/protobuf/enum.rb +303 -0
  26. data/lib/protobuf/exceptions.rb +9 -0
  27. data/lib/protobuf/field.rb +74 -0
  28. data/lib/protobuf/field/base_field.rb +267 -0
  29. data/lib/protobuf/field/bool_field.rb +59 -0
  30. data/lib/protobuf/field/bytes_field.rb +82 -0
  31. data/lib/protobuf/field/double_field.rb +25 -0
  32. data/lib/protobuf/field/enum_field.rb +68 -0
  33. data/lib/protobuf/field/field_array.rb +87 -0
  34. data/lib/protobuf/field/fixed32_field.rb +25 -0
  35. data/lib/protobuf/field/fixed64_field.rb +28 -0
  36. data/lib/protobuf/field/float_field.rb +41 -0
  37. data/lib/protobuf/field/int32_field.rb +21 -0
  38. data/lib/protobuf/field/int64_field.rb +21 -0
  39. data/lib/protobuf/field/integer_field.rb +23 -0
  40. data/lib/protobuf/field/message_field.rb +65 -0
  41. data/lib/protobuf/field/sfixed32_field.rb +27 -0
  42. data/lib/protobuf/field/sfixed64_field.rb +28 -0
  43. data/lib/protobuf/field/signed_integer_field.rb +29 -0
  44. data/lib/protobuf/field/sint32_field.rb +21 -0
  45. data/lib/protobuf/field/sint64_field.rb +21 -0
  46. data/lib/protobuf/field/string_field.rb +34 -0
  47. data/lib/protobuf/field/uint32_field.rb +21 -0
  48. data/lib/protobuf/field/uint64_field.rb +21 -0
  49. data/lib/protobuf/field/varint_field.rb +73 -0
  50. data/lib/protobuf/generators/base.rb +70 -0
  51. data/lib/protobuf/generators/enum_generator.rb +41 -0
  52. data/lib/protobuf/generators/extension_generator.rb +27 -0
  53. data/lib/protobuf/generators/field_generator.rb +131 -0
  54. data/lib/protobuf/generators/file_generator.rb +135 -0
  55. data/lib/protobuf/generators/group_generator.rb +112 -0
  56. data/lib/protobuf/generators/message_generator.rb +98 -0
  57. data/lib/protobuf/generators/printable.rb +160 -0
  58. data/lib/protobuf/generators/service_generator.rb +26 -0
  59. data/lib/protobuf/lifecycle.rb +33 -0
  60. data/lib/protobuf/logging.rb +39 -0
  61. data/lib/protobuf/message.rb +193 -0
  62. data/lib/protobuf/message/fields.rb +133 -0
  63. data/lib/protobuf/message/serialization.rb +89 -0
  64. data/lib/protobuf/optionable.rb +23 -0
  65. data/lib/protobuf/rpc/buffer.rb +77 -0
  66. data/lib/protobuf/rpc/client.rb +168 -0
  67. data/lib/protobuf/rpc/connector.rb +19 -0
  68. data/lib/protobuf/rpc/connectors/base.rb +55 -0
  69. data/lib/protobuf/rpc/connectors/common.rb +176 -0
  70. data/lib/protobuf/rpc/connectors/socket.rb +73 -0
  71. data/lib/protobuf/rpc/connectors/zmq.rb +322 -0
  72. data/lib/protobuf/rpc/dynamic_discovery.pb.rb +49 -0
  73. data/lib/protobuf/rpc/env.rb +58 -0
  74. data/lib/protobuf/rpc/error.rb +28 -0
  75. data/lib/protobuf/rpc/error/client_error.rb +31 -0
  76. data/lib/protobuf/rpc/error/server_error.rb +43 -0
  77. data/lib/protobuf/rpc/middleware.rb +25 -0
  78. data/lib/protobuf/rpc/middleware/exception_handler.rb +36 -0
  79. data/lib/protobuf/rpc/middleware/logger.rb +91 -0
  80. data/lib/protobuf/rpc/middleware/request_decoder.rb +83 -0
  81. data/lib/protobuf/rpc/middleware/response_encoder.rb +88 -0
  82. data/lib/protobuf/rpc/middleware/runner.rb +18 -0
  83. data/lib/protobuf/rpc/rpc.pb.rb +55 -0
  84. data/lib/protobuf/rpc/server.rb +39 -0
  85. data/lib/protobuf/rpc/servers/socket/server.rb +123 -0
  86. data/lib/protobuf/rpc/servers/socket/worker.rb +56 -0
  87. data/lib/protobuf/rpc/servers/socket_runner.rb +40 -0
  88. data/lib/protobuf/rpc/servers/zmq/broker.rb +193 -0
  89. data/lib/protobuf/rpc/servers/zmq/server.rb +320 -0
  90. data/lib/protobuf/rpc/servers/zmq/util.rb +48 -0
  91. data/lib/protobuf/rpc/servers/zmq/worker.rb +104 -0
  92. data/lib/protobuf/rpc/servers/zmq_runner.rb +62 -0
  93. data/lib/protobuf/rpc/service.rb +179 -0
  94. data/lib/protobuf/rpc/service_directory.rb +253 -0
  95. data/lib/protobuf/rpc/service_dispatcher.rb +46 -0
  96. data/lib/protobuf/rpc/service_filters.rb +272 -0
  97. data/lib/protobuf/rpc/stat.rb +97 -0
  98. data/lib/protobuf/socket.rb +21 -0
  99. data/lib/protobuf/tasks.rb +1 -0
  100. data/lib/protobuf/tasks/compile.rake +61 -0
  101. data/lib/protobuf/version.rb +3 -0
  102. data/lib/protobuf/wire_type.rb +10 -0
  103. data/lib/protobuf/zmq.rb +21 -0
  104. data/proto/dynamic_discovery.proto +44 -0
  105. data/proto/google/protobuf/compiler/plugin.proto +147 -0
  106. data/proto/google/protobuf/descriptor.proto +620 -0
  107. data/proto/rpc.proto +62 -0
  108. data/protobuf.gemspec +51 -0
  109. data/spec/benchmark/tasks.rb +139 -0
  110. data/spec/bin/protoc-gen-ruby_spec.rb +23 -0
  111. data/spec/data/data.bin +3 -0
  112. data/spec/data/types.bin +0 -0
  113. data/spec/encoding/all_types_spec.rb +105 -0
  114. data/spec/encoding/extreme_values_spec.rb +0 -0
  115. data/spec/functional/class_inheritance_spec.rb +52 -0
  116. data/spec/functional/socket_server_spec.rb +59 -0
  117. data/spec/functional/zmq_server_spec.rb +105 -0
  118. data/spec/lib/protobuf/cli_spec.rb +273 -0
  119. data/spec/lib/protobuf/code_generator_spec.rb +60 -0
  120. data/spec/lib/protobuf/enum_spec.rb +265 -0
  121. data/spec/lib/protobuf/field/bool_field_spec.rb +51 -0
  122. data/spec/lib/protobuf/field/field_array_spec.rb +69 -0
  123. data/spec/lib/protobuf/field/float_field_spec.rb +55 -0
  124. data/spec/lib/protobuf/field/int32_field_spec.rb +89 -0
  125. data/spec/lib/protobuf/field/string_field_spec.rb +45 -0
  126. data/spec/lib/protobuf/field_spec.rb +191 -0
  127. data/spec/lib/protobuf/generators/base_spec.rb +84 -0
  128. data/spec/lib/protobuf/generators/enum_generator_spec.rb +73 -0
  129. data/spec/lib/protobuf/generators/extension_generator_spec.rb +42 -0
  130. data/spec/lib/protobuf/generators/field_generator_spec.rb +102 -0
  131. data/spec/lib/protobuf/generators/file_generator_spec.rb +32 -0
  132. data/spec/lib/protobuf/generators/message_generator_spec.rb +0 -0
  133. data/spec/lib/protobuf/generators/service_generator_spec.rb +46 -0
  134. data/spec/lib/protobuf/lifecycle_spec.rb +94 -0
  135. data/spec/lib/protobuf/message_spec.rb +526 -0
  136. data/spec/lib/protobuf/optionable_spec.rb +46 -0
  137. data/spec/lib/protobuf/rpc/client_spec.rb +66 -0
  138. data/spec/lib/protobuf/rpc/connector_spec.rb +26 -0
  139. data/spec/lib/protobuf/rpc/connectors/base_spec.rb +50 -0
  140. data/spec/lib/protobuf/rpc/connectors/common_spec.rb +170 -0
  141. data/spec/lib/protobuf/rpc/connectors/socket_spec.rb +36 -0
  142. data/spec/lib/protobuf/rpc/connectors/zmq_spec.rb +117 -0
  143. data/spec/lib/protobuf/rpc/middleware/exception_handler_spec.rb +62 -0
  144. data/spec/lib/protobuf/rpc/middleware/logger_spec.rb +49 -0
  145. data/spec/lib/protobuf/rpc/middleware/request_decoder_spec.rb +115 -0
  146. data/spec/lib/protobuf/rpc/middleware/response_encoder_spec.rb +75 -0
  147. data/spec/lib/protobuf/rpc/servers/socket_server_spec.rb +38 -0
  148. data/spec/lib/protobuf/rpc/servers/zmq/server_spec.rb +43 -0
  149. data/spec/lib/protobuf/rpc/servers/zmq/util_spec.rb +55 -0
  150. data/spec/lib/protobuf/rpc/servers/zmq/worker_spec.rb +35 -0
  151. data/spec/lib/protobuf/rpc/service_directory_spec.rb +293 -0
  152. data/spec/lib/protobuf/rpc/service_dispatcher_spec.rb +52 -0
  153. data/spec/lib/protobuf/rpc/service_filters_spec.rb +517 -0
  154. data/spec/lib/protobuf/rpc/service_spec.rb +162 -0
  155. data/spec/lib/protobuf/rpc/stat_spec.rb +68 -0
  156. data/spec/lib/protobuf_spec.rb +98 -0
  157. data/spec/spec_helper.rb +44 -0
  158. data/spec/support/all.rb +6 -0
  159. data/spec/support/packed_field.rb +22 -0
  160. data/spec/support/server.rb +64 -0
  161. data/spec/support/test/all_types.data.bin +0 -0
  162. data/spec/support/test/all_types.data.txt +119 -0
  163. data/spec/support/test/defaults.pb.rb +27 -0
  164. data/spec/support/test/defaults.proto +9 -0
  165. data/spec/support/test/enum.pb.rb +55 -0
  166. data/spec/support/test/enum.proto +34 -0
  167. data/spec/support/test/extended.pb.rb +18 -0
  168. data/spec/support/test/extended.proto +10 -0
  169. data/spec/support/test/extreme_values.data.bin +0 -0
  170. data/spec/support/test/google_unittest.pb.rb +537 -0
  171. data/spec/support/test/google_unittest.proto +713 -0
  172. data/spec/support/test/google_unittest_import.pb.rb +39 -0
  173. data/spec/support/test/google_unittest_import.proto +64 -0
  174. data/spec/support/test/google_unittest_import_public.pb.rb +10 -0
  175. data/spec/support/test/google_unittest_import_public.proto +38 -0
  176. data/spec/support/test/multi_field_extensions.pb.rb +58 -0
  177. data/spec/support/test/multi_field_extensions.proto +33 -0
  178. data/spec/support/test/resource.pb.rb +119 -0
  179. data/spec/support/test/resource.proto +94 -0
  180. data/spec/support/test/resource_service.rb +23 -0
  181. data/spec/support/test_app_file.rb +2 -0
  182. metadata +502 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ffdfa498e7e022de5f1acf981e7d86b5152bca83
4
+ data.tar.gz: a250e7c23b165db5a131749d9e335104ecd67bd8
5
+ SHA512:
6
+ metadata.gz: 4574b1abd2e9fb2548d9d6108cdeb195de3d2d6e7fb5bc28652cf291b809db9505350acb7c4bdda090bedcb358172240d8a2c5bcb5af4a8381bdbd51b807d977
7
+ data.tar.gz: 04267ac60604c82402b7d406b3ccb4a73d35f96d7be4f532ff696ce4c43c7a2fef820b478a1f1681bbf0f3d01737e0197d01bd870c10cb99b2fe77cc5d6af043
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.swp
3
+ pkg/*
4
+ .bundle
5
+ .rvmrc
6
+ .rspec
7
+ *.log
8
+ coverage
9
+ doc
10
+ .yardoc
11
+ .DS_Store
12
+ *.so
13
+ Gemfile.lock
14
+ tmp/*
15
+ ext/defs
16
+ ext/out
17
+ ext/ruby_generator/protoc-ruby
18
+ .ruby-gemset
19
+ .ruby-version
20
+ ext/ruby_generator/gdb.run
21
+ ext/ruby_generator/protoc-ruby.dSYM
@@ -0,0 +1,51 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ Lint/EndAlignment:
4
+ AlignWith: variable
5
+
6
+ Lint/Loop:
7
+ Enabled: false
8
+
9
+ Metrics/ClassLength:
10
+ Enabled: false
11
+
12
+ Style/CaseIndentation:
13
+ IndentWhenRelativeTo: end
14
+
15
+ Style/ClassAndModuleChildren:
16
+ Exclude:
17
+ - '**/*.pb.rb'
18
+
19
+ Style/EmptyLineBetweenDefs:
20
+ AllowAdjacentOneLineDefs: true
21
+
22
+ Style/EmptyLines:
23
+ Exclude:
24
+ - '**/*.pb.rb'
25
+
26
+ Style/FileName:
27
+ Exclude:
28
+ - '**/protoc-gen-ruby*'
29
+
30
+ Style/GuardClause:
31
+ MinBodyLength: 4
32
+
33
+ Style/HashSyntax:
34
+ EnforcedStyle: hash_rockets
35
+
36
+ Style/IndentHash:
37
+ EnforcedStyle: consistent
38
+
39
+ Style/Semicolon:
40
+ AllowAsExpressionSeparator: true
41
+
42
+ Style/TrailingBlankLines:
43
+ Exclude:
44
+ - '**/*.pb.rb'
45
+
46
+ Style/TrailingComma:
47
+ EnforcedStyleForMultiline: comma
48
+
49
+ Style/TrivialAccessors:
50
+ AllowDSLWriters: true
51
+ AllowPredicates: true
@@ -0,0 +1,89 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2014-12-23 08:21:59 -0800 using RuboCop version 0.28.0.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ # Offense count: 29
9
+ Metrics/AbcSize:
10
+ Max: 59
11
+
12
+ # Offense count: 3
13
+ Metrics/BlockNesting:
14
+ Max: 5
15
+
16
+ # Offense count: 8
17
+ # Configuration parameters: CountComments.
18
+ Metrics/ClassLength:
19
+ Max: 232
20
+
21
+ # Offense count: 3
22
+ Metrics/CyclomaticComplexity:
23
+ Max: 10
24
+
25
+ # Offense count: 491
26
+ # Configuration parameters: AllowURI, URISchemes.
27
+ Metrics/LineLength:
28
+ Max: 196
29
+
30
+ # Offense count: 43
31
+ # Configuration parameters: CountComments.
32
+ Metrics/MethodLength:
33
+ Max: 38
34
+
35
+ # Offense count: 2
36
+ # Configuration parameters: CountKeywordArgs.
37
+ Metrics/ParameterLists:
38
+ Max: 6
39
+
40
+ # Offense count: 3
41
+ Metrics/PerceivedComplexity:
42
+ Max: 11
43
+
44
+ # Offense count: 189
45
+ Style/Documentation:
46
+ Enabled: false
47
+
48
+ # Offense count: 12
49
+ Style/DoubleNegation:
50
+ Enabled: false
51
+
52
+ # Offense count: 2
53
+ Style/EmptyElse:
54
+ Enabled: false
55
+
56
+ # Offense count: 73
57
+ # Cop supports --auto-correct.
58
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
59
+ Style/EmptyLinesAroundBlockBody:
60
+ Enabled: false
61
+
62
+ # Offense count: 90
63
+ # Cop supports --auto-correct.
64
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
65
+ Style/EmptyLinesAroundClassBody:
66
+ Enabled: false
67
+
68
+ # Offense count: 50
69
+ # Cop supports --auto-correct.
70
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
71
+ Style/EmptyLinesAroundModuleBody:
72
+ Enabled: false
73
+
74
+ # Offense count: 46
75
+ # Cop supports --auto-correct.
76
+ Style/NumericLiterals:
77
+ MinDigits: 21
78
+
79
+ # Offense count: 463
80
+ # Cop supports --auto-correct.
81
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
82
+ Style/StringLiterals:
83
+ Enabled: false
84
+
85
+ # Offense count: 4
86
+ # Cop supports --auto-correct.
87
+ # Configuration parameters: WordRegex.
88
+ Style/WordArray:
89
+ MinSize: 2
@@ -0,0 +1,25 @@
1
+ before_install:
2
+ - sudo apt-get update -qq
3
+ - sudo apt-get install -y libzmq3-dev
4
+ - sudo -E ./install-protobuf.sh
5
+ language: ruby
6
+ rvm:
7
+ - 1.9.3
8
+ - 2.0.0
9
+ - 2.1
10
+ - jruby
11
+ - rbx-2
12
+ env:
13
+ - PROTOBUF_VERSION=2.6.1
14
+ - PROTOBUF_VERSION=3.0.0-alpha-2
15
+ matrix:
16
+ allow_failures:
17
+ - rvm: rbx-2
18
+ - env: PROTOBUF_VERSION=3.0.0-alpha-2
19
+ notifications:
20
+ webhooks:
21
+ urls:
22
+ - https://webhooks.gitter.im/e/51a956bcd2b1854d6756
23
+ on_success: change # options: [always|never|change] default: always
24
+ on_failure: always # options: [always|never|change] default: always
25
+ on_start: false # default: false
@@ -0,0 +1,5 @@
1
+ --no-private
2
+ --hide-void-return
3
+
4
+ --markup-provider=redcarpet
5
+ --markup=markdown
@@ -0,0 +1,256 @@
1
+ # Stable (3.x)
2
+
3
+ 3.0.4
4
+ --------
5
+
6
+ - Raise specific MethodNotFound when service class doesn't respond to (publicly implement)
7
+ the rpc method called from the client. Stop rescuing all NoMethodError's thrown
8
+ by service implementations. [#193, @liveh2o]
9
+
10
+ 3.0.3
11
+ ---------
12
+
13
+ - Fix recursive memory/cpu growth issue when calling class-level `Message.to_json`. [#190]
14
+
15
+ 3.0.2
16
+ ---------
17
+
18
+ - Queue requests at the broker when concurrent requests hit the ZMQ server, distribute to
19
+ worker threads on each turn of the read poll loop. [#189, @abrandoned, @liveh2o]
20
+
21
+ 3.0.1
22
+ ---------
23
+
24
+ - Fix NoMethodError that can occur when serializing a message with a missing required field. [#187, @abrandoned]
25
+
26
+ 3.0.0
27
+ ---------
28
+
29
+ A lot has changed since the last stable v2.8.12. For all the relevant changes,
30
+ see the closed [pull requests and issues list in github](https://github.com/localshred/protobuf/issues?milestone=1&state=closed).
31
+ Below is a high-level list of fixes, deprecations, breaking changes, and new APIs.
32
+
33
+ ### EventMachine is dead, Long live EventMachine
34
+
35
+ The EventMachine client and server have been removed from this gem. They code was far
36
+ too error prone and flawed to feasibly support going forward. It's recommended
37
+ to switch to the socket implementation (using `PB_CLIENT_TYPE` and `PB_SERVER_TYPE` of `socket`)
38
+ for a painless switchover. The ZMQ implementation is much more performant but
39
+ does have a dependency on libzmq.
40
+
41
+ ### Server Middlewares
42
+
43
+ The server/dispatcher stack has been converted to the Middleware pattern!
44
+ Exception handling (#162, #164), Request decoding (#160, #166), Response encoding (#161, #167),
45
+ Logging and stats (#163), and Method dispatch (#159) have all been extracted into their
46
+ own Middlewares to greatly simplify testing and further development of the server
47
+ stack, furthering our preparations for removing the socket implementations (zmq, socket)
48
+ into their own gems in version 4.0. Major props to @liveh2o for [tackling this beast](https://github.com/localshred/protobuf/tree/master/lib/protobuf/rpc/middleware).
49
+
50
+ #### Bug Fixes
51
+
52
+ - Resolve DNS names (e.g. localhost) when using ZMQ server. [#46, reported by @reddshack]
53
+ - Switched to hash based value storage for messages to fix large field tag memory issues. [#118, #165]
54
+ - `Enum.fetch` used to return an enum of any type if that is the value passed in. [#168]
55
+
56
+ #### Deprecations
57
+
58
+ __!! NOTE: These deprecated methods will be removed in v3.1. !!__
59
+
60
+ - Deprecated `BaseField#type` in favor of `#type_class`.
61
+ - Deprecated `Message.get_ext_field_by_name` in favor of `.get_extension_field` or `.get_field(name_or_tag, true)`.
62
+ - Deprecated `Message.get_ext_field_by_tag,` in favor of `.get_extension_field` or `.get_field(name_or_tag, true)`.
63
+ - Deprecated `Message.get_field_by_name,` in favor of `.get_field`.
64
+ - Deprecated `Message.get_field_by_tag,` in favor of `.get_field`.
65
+ - Deprecated `Enum.enum_by_value` in favor of `.enum_for_tag`.
66
+ - Deprecated `Enum.name_by_value` in favor of `.name_for_tag`.
67
+ - Deprecated `Enum.get_name_by_tag` in favor of `.name_for_tag`.
68
+ - Deprecated `Enum.value_by_name` in favor of `.enum_for_name`.
69
+ - Deprecated `Enum.values` in favor of `.enums`. Beware that `.enums` returns an array where `.values` returns a hash.
70
+ Use `.all_tags` if you just need all the valid tag numbers. In other words, don't do this anymore: `MyEnum.values.values.map(&:to_i).uniq`.
71
+
72
+ #### Breaking Changes
73
+
74
+ - Require Active Support 3.2+. [#177]
75
+ - All files/classes relating to the EventMachine client and server are gone. Use `PB_CLIENT_TYPE` and `PB_SERVER_TYPE` of `socket` instead. [#116]
76
+ - Cleaned up the `Enum` class, deprecating/renaming most methods. tl;dr, just use `MyEnum.fetch`.
77
+ See #134 for more comprehensive documentation about which methods are going and away and which are being renamed. [#134]
78
+ - Pulled `EnumValue` into `Enum`. The `EnumValue` class no longer exists. Use `Enum` for type-checking instead. [#168].
79
+ - Removed previously deprecated `bin/rprotoc` executable. Use `protoc --ruby_out=...` instead. [13fbdb9]
80
+ - Removed previously deprecated `Service#rpc` method. Use `Service#env#method_name` instead. [f391294]
81
+ - Changed the `Service#initialize` to take an `Env` object instead of separate request, method, and client parameters. [6c61bf72]
82
+ - Removed attribute readers for `Service#method_name` and `Service#client_host`. Use `Service#env` to get them instead.
83
+ - Removed `lib/protobuf/message/message.rb`. Use `lib/protobuf/message.rb` instead.
84
+ - Removed field getters from Message instances (e.g. `Message#get_field_by_name`).
85
+ Use class-level getters instead (see Deprecations section).
86
+ - Moved `lib/protobuf/message/decoder.rb` to `lib/protobuf/decoder.rb`. The module is still named `Protobuf::Decoder`.
87
+ - Removed `Protobuf::Field::ExtensionFields` class.
88
+ - Removed instance-level `max` and `min` methods from all relevant Field classes (e.g. Int32Field, Uint64Field, etc).
89
+ Use class-level methods of the same names instead. [#176, 992eb051]
90
+ - `PbError#to_response` no longer receives an argument, instead returning a new `Socketrpc::Response` object. [#147, @liveh2o]
91
+ - The Server module has been stripped of almost all methods, now simply invokes the Middleware stack for each request. [#159, @liveh2o]
92
+ - Removed `Protobuf::PROTOC_VERSION` constant now that the compiler supports any protoc version.
93
+
94
+ #### New APIs
95
+
96
+ - Added support for [enum `allow_alias` option](https://developers.google.com/protocol-buffers/docs/proto#enum). [#134]
97
+ - `Enum.all_tags` returns an array of unique tags. Use it to replace `Enum.values.values.map(&:to_i)` (`Enum.values` is deprecated).
98
+ - `Enum.enums` returns an array of all defined enums for that class (including any aliased Enums).
99
+ - Reinstated support for symbol primitive field types in generated Message code. [#170]
100
+ - `Message.get_field` accepts a second boolean parameter (default false) to return an extension field if found. [#169]
101
+ - Mirror existing `Decoder#decode_from(stream)` with `Encoder#encode_to(stream)`. [#169]
102
+ - `Server` now invokes the [middleware stack](https://github.com/localshred/protobuf/tree/master/lib/protobuf/rpc/middleware) for request handling. [#159, @liveh2o]
103
+ - Added `protobuf:compile` and `protobuf:clean` rake tasks. Simply `load 'protobuf/tasks/compile.rake'` in your Rakefile (see `compile.rake` for arguments and usage). [#142, #143]
104
+ - Add `Protobuf::Deprecator` module to alias deprecated methods. [#165]
105
+ - Add support for assigning a symbol to a string or bytes field. [#181, @abrandoned]
106
+ - Add `first_alive_load_balance` option to rpc server. Pass `PB_FIRST_ALIVE_LOAD_BALANCE`
107
+ as an env variable to the client process to ensure the client asks the server
108
+ if it is alive (able to server requests to clients). [#183, @abrandoned]
109
+
110
+ 2.8.13
111
+ ---------
112
+
113
+ - Backport #190 to 2.8 stable series. [#192]
114
+
115
+ 2.8.12
116
+ ---------
117
+
118
+ - Fix thread busy access in zmq server/worker. [#151, @abrandoned]
119
+
120
+ 2.8.11
121
+ ---------
122
+
123
+ - Default ZMQ server to use inproc protocol instead of tcp (zero-copy between server-broker-worker). [#145, @brianstien]
124
+ - Add `broadcast_busy` functionality that removes server from cluster if the workers are full. [#149, @abrandoned]
125
+ - Add cli option for `--no-zmq_inproc`. [#149, @abrandoned]
126
+ - Add cli option for `--broadcast_busy`. [#149, @abrandoned]
127
+
128
+ 2.8.10
129
+ ---------
130
+
131
+ - Allow passing a file extension to compile/clean rake tasks. [#143]
132
+
133
+ 2.8.9
134
+ ---------
135
+
136
+ - Deprecated Protobuf::Lifecycle module in favor of using ActiveSupport::Notifications. [#139, @devin-c]
137
+ - Modify `$LOAD_PATH` inside descriptors.rb to make it easier for other libraries to write their own compiler plugins using our pre-compiled descriptors. [#141]
138
+ - Add protobuf:clean and protobuf:compile rake tasks for use in external libraries to compile source definitions to a destination. [#142]
139
+
140
+ 2.8.8
141
+ ---------
142
+
143
+ - ServiceDirectory beacons broadcast on same ip as listening clients. [#133, @devin-c]
144
+
145
+ 2.8.7
146
+ ---------
147
+
148
+ - Fire ActiveSupport load hooks when RPC Server and Client classes are loaded. [#126, @liveh2o]
149
+ - Prevent infinite loop when doing service lookup from directory. [#125, @brianstien]
150
+
151
+ 2.8.6
152
+ ---------
153
+
154
+ - Fix string/byte encoding issue when unicode characters present. Reported by @foxban. This was also backported to v2.7.12. [#120]
155
+
156
+ 2.8.5
157
+ ----------
158
+
159
+ - Fix issue where ServiceDirectory lookups were failing when given a class name, breaking the directory load balancing. (#119)
160
+
161
+ 2.8.4
162
+ ----------
163
+
164
+ - Fix issue where frozen strings assigned in a repeated field would cause encoding runtime errors. (#117)
165
+
166
+ 2.8.3
167
+ ----------
168
+
169
+ - Add Deprecation warning when requiring `protobuf/evented`. Version 3.x will not support the eventmachine transport layer for client or server.
170
+
171
+ 2.8.2
172
+ ----------
173
+
174
+ - Remove the <4.0 version constraint on ActiveSupport.
175
+
176
+ 2.8.1
177
+ ----------
178
+
179
+ - Improve `ServiceDirectory` lookup speed ~10x, lookups now done in constant time (devin-c).
180
+ - Add Timestamp to end of rpc stat log (represents ending time of request processing).
181
+ - Set `request_size` in the rpc stat within ZMQ Worker (previously missing).
182
+ - Ensure `request_size` and `response_size` are set on rpc stat for client requests.
183
+
184
+ 2.8.0
185
+ -----------
186
+
187
+ - New compiler supports protobuf compilation/runtime with protoc <= v2.5.0 (c++ compiler removed). [#109]
188
+ - Deprecated rprotoc in favor of protoc. [0bc9674]
189
+ - Added service dynamic discovery to the ZMQ connector and server. [#91, @devin-c]
190
+ - No longer creating `-java` platform gem due to removal of c++ compiler.
191
+ - Added WTFPL license.
192
+
193
+ 2.7.12
194
+ -----------
195
+
196
+ - Backport string/byte encoding issue when unicode characters present. [code: #122, original issue: #120]
197
+
198
+ 2.0.0
199
+ -----------
200
+
201
+ #### `rprotoc` changes
202
+
203
+ * New option `--ruby_out` to specify the output directory to place generated ruby files. If not provided, ruby code will not be generated.
204
+ * Extends `libprotoc` to hook in directly to google's provided compiler mechanism.
205
+ * Removed all previous compiler code including the racc parser, node visitors, etc.
206
+ * See `protoc --help` for default options.
207
+
208
+ #### `rprotoc` generated files changes
209
+
210
+ * Import `require`s now occur outside of any module or class declaration which solves ruby vm warnings previously seen.
211
+ * Empty inherited Message and Enum classes are pre-defined in the file, then reopened and their fields applied. This solves the issue of recursive field dependencies of two or more types in the same file.
212
+ * Generated DSL lines for message fields include the fully qualified name of the type (e.g. `optional ::Protobuf::Field::StringField, :name, 1`)
213
+ * Support for any combination of `packed`, `deprecated`, and `default` as options to pass to a field definition.
214
+ * Services are now generated in the corresponding `.pb.rb` file instead of their own `*_service.rb` files as before.
215
+
216
+ #### `rpc_server` changes
217
+
218
+ * Removed `--env` option. The running application or program is solely in charge of ensuring it's environment is properly loaded.
219
+ * Removed reading of `PB_CLIENT_TYPE`, `PB_SERVER_TYPE` environment variables. Should use mode switches or custom requires (see below) instead.
220
+ * Removed `--client_socket` in favor of using mode switches. This also means client calls made by the `rpc_server` will run as the same connector type as the given mode (socket, zmq, or evented).
221
+ * Removed `--pre-cache-definitions` switch in favor of always pre-caching for performance.
222
+ * Removed `--gc-pause-serialization` since using `--gc-pause-request` in conjunction was redundant.
223
+ * Removed `--client-type` in favor of mode switches.
224
+ * Removed `--server-type` in favor of mode switches.
225
+ * Added mode switch `--evented`.
226
+ * Added `--threads` to specify number of ZMQ Worker threads to use. Ignored if mode is not zmq.
227
+ * Added `--print-deprecation-warnings` switch to tell the server whether or not to print deprecation warnings on field usage. Enabled by default.
228
+ * See `rpc_server help start` for all options and usage. Note: the `start` task is the default and not necessary when running the `rpc_server`.
229
+
230
+ #### Message changes
231
+
232
+ * `Message#get_field` usage should now specify either `Message#get_field_by_name` or `Message#get_field_by_tag`, depending on your lookup criteria.
233
+ * Support for STDERR output when accessing a message field which has been defined as `[deprecated=true]`. Deprecated warnings can be skipped by running your application or program with `PB_IGNORE_DEPRECATIONS=1`.
234
+ * Significant internal refactoring which provides huge boosts in speed and efficiency both in accessing/writing Message field values, as well as serialization and deserialization routines.
235
+ * Refactor `Message#to_hash` to delegate hash representations to the field values, simply collecting the display values and returning a hash of fields that are set. This also affects `to_json` output.
236
+
237
+ #### Enum changes
238
+
239
+ * Add `Enum.fetch` class method to polymorphically retrieve an `EnumValue` object.
240
+ * Add `Enum.value_by_name` to retrieve the corresponding `EnumValue` to the given symbol name.
241
+ * Add `Enum.enum_by_value` to retrieve the corresponding `EnumValue` to the given integer value.
242
+
243
+ #### RPC Service changes
244
+
245
+ * `async_responder` paradigm is no longer supported.
246
+ * `self.response=` paradigm should be converted to using `respond_with(object)`.
247
+ * Significant internal changes that should not bleed beyond the API but which make maintaining the code much easier.
248
+
249
+ #### RPC Client changes
250
+
251
+ * In the absence of `PB_CLIENT_TYPE` environment var, you should be requiring the specific connector type specifically. For instance, if you wish to run in zmq mode for client requests, update your Gemfile: `gem 'protobuf', :require => 'protobuf/zmq'`.
252
+ * `:async` option on client calls is no longer recognized.
253
+
254
+ #### Other changes
255
+
256
+ * Moved files out of `lib/protobuf/common` folder into `lib/protobuf`. Files affected are logger, wire\_type, util. The only update would need to be the require path to these files since the modules were always `Protobuf::{TYPE}`.