Releases: ruby-protobuf/protobuf
Releases · ruby-protobuf/protobuf
v2.8.0.beta4
Version 2.8.0.beta4
v2.8.0.beta3
Version 2.8.0.beta3
v2.8.0.beta2
Version 2.8.0.beta2
v2.8.0.beta1
Version 2.8.0.beta1
v2.0.0
rprotoc
changes
- New option
--ruby_out
to specify the output directory to place generated ruby files. If not provided, ruby code will not be generated. - Extends
libprotoc
to hook in directly to google's provided compiler mechanism. - Removed all previous compiler code including the racc parser, node visitors, etc.
- See
protoc --help
for default options.
rprotoc
generated files changes
- Import
require
s now occur outside of any module or class declaration which solves ruby vm warnings previously seen. - 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.
- Generated DSL lines for message fields include the fully qualified name of the type (e.g.
optional ::Protobuf::Field::StringField, :name, 1
) - Support for any combination of
packed
,deprecated
, anddefault
as options to pass to a field definition. - Services are now generated in the corresponding
.pb.rb
file instead of their own*_service.rb
files as before.
rpc_server
changes
- Removed
--env
option. The running application or program is solely in charge of ensuring it's environment is properly loaded. - Removed reading of
PB_CLIENT_TYPE
,PB_SERVER_TYPE
environment variables. Should use mode switches or custom requires (see below) instead. - Removed
--client_socket
in favor of using mode switches. This also means client calls made by therpc_server
will run as the same connector type as the given mode (socket, zmq, or evented). - Removed
--pre-cache-definitions
switch in favor of always pre-caching for performance. - Removed
--gc-pause-serialization
since using--gc-pause-request
in conjunction was redundant. - Removed
--client-type
in favor of mode switches. - Removed
--server-type
in favor of mode switches. - Added mode switch
--evented
. - Added
--threads
to specify number of ZMQ Worker threads to use. Ignored if mode is not zmq. - Added
--print-deprecation-warnings
switch to tell the server whether or not to print deprecation warnings on field usage. Enabled by default. - See
rpc_server help start
for all options and usage. Note: thestart
task is the default and not necessary when running therpc_server
.
Message changes
Message#get_field
usage should now specify eitherMessage#get_field_by_name
orMessage#get_field_by_tag
, depending on your lookup criteria.- 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 withPB_IGNORE_DEPRECATIONS=1
. - 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.
- 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 affectsto_json
output.
Enum changes
- Add
Enum.fetch
class method to polymorphically retrieve anEnumValue
object. - Add
Enum.value_by_name
to retrieve the correspondingEnumValue
to the given symbol name. - Add
Enum.enum_by_value
to retrieve the correspondingEnumValue
to the given integer value.
RPC Service changes
async_responder
paradigm is no longer supported.self.response=
paradigm should be converted to usingrespond_with(object)
.- Significant internal changes that should not bleed beyond the API but which make maintaining the code much easier.
RPC Client changes
- 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'
. :async
option on client calls is no longer recognized.
Other changes
- Moved files out of
lib/protobuf/common
folder intolib/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 alwaysProtobuf::{TYPE}
.