grpc 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -2
  3. data/bin/{interop/test/cpp/interop/test.rb → grpc_ruby_interop_client} +4 -14
  4. data/bin/{interop/test/cpp/interop/empty.rb → grpc_ruby_interop_server} +4 -15
  5. data/bin/interop/interop_client.rb +9 -335
  6. data/bin/interop/interop_server.rb +9 -153
  7. data/bin/math_client.rb +3 -3
  8. data/bin/math_server.rb +18 -1
  9. data/bin/noproto_server.rb +2 -1
  10. data/ext/grpc/rb_call.c +82 -15
  11. data/ext/grpc/rb_channel.c +141 -11
  12. data/ext/grpc/rb_channel_args.c +2 -1
  13. data/ext/grpc/rb_completion_queue.c +8 -7
  14. data/ext/grpc/rb_credentials.c +7 -6
  15. data/ext/grpc/rb_grpc.c +23 -8
  16. data/ext/grpc/rb_server.c +31 -45
  17. data/ext/grpc/rb_server_credentials.c +91 -34
  18. data/lib/grpc/generic/active_call.rb +7 -7
  19. data/lib/grpc/generic/bidi_call.rb +17 -12
  20. data/lib/grpc/generic/client_stub.rb +88 -22
  21. data/lib/grpc/generic/rpc_server.rb +19 -18
  22. data/lib/grpc/generic/service.rb +8 -10
  23. data/lib/grpc/grpc.so +0 -0
  24. data/lib/grpc/logconfig.rb +26 -10
  25. data/lib/grpc/version.rb +1 -1
  26. data/spec/call_spec.rb +9 -1
  27. data/spec/channel_spec.rb +2 -2
  28. data/spec/client_server_spec.rb +28 -11
  29. data/spec/credentials_spec.rb +7 -7
  30. data/spec/generic/active_call_spec.rb +43 -18
  31. data/spec/generic/client_stub_spec.rb +21 -1
  32. data/spec/generic/rpc_server_spec.rb +20 -9
  33. data/spec/pb/health/checker_spec.rb +232 -0
  34. data/spec/server_credentials_spec.rb +32 -7
  35. data/spec/server_spec.rb +8 -4
  36. data/spec/spec_helper.rb +13 -1
  37. metadata +31 -51
  38. data/.gitignore +0 -15
  39. data/.rspec +0 -4
  40. data/.rubocop.yml +0 -10
  41. data/.rubocop_todo.yml +0 -44
  42. data/CHANGELOG.md +0 -11
  43. data/Gemfile +0 -4
  44. data/README.md +0 -84
  45. data/bin/interop/README.md +0 -8
  46. data/bin/interop/test/cpp/interop/messages.rb +0 -89
  47. data/bin/interop/test/cpp/interop/test_services.rb +0 -60
  48. data/grpc.gemspec +0 -40
data/.gitignore DELETED
@@ -1,15 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- *.bundle
11
- *.so
12
- *.o
13
- *.a
14
- mkmf.log
15
- vendor
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- -I.
2
- --require spec_helper
3
- --format documentation
4
- --color
@@ -1,10 +0,0 @@
1
- # This is the configuration used to check the rubocop source code.
2
-
3
- inherit_from: .rubocop_todo.yml
4
-
5
- AllCops:
6
- Exclude:
7
- - 'bin/apis/**/*'
8
- - 'bin/interop/test/**/*'
9
- - 'bin/math.rb'
10
- - 'bin/math_services.rb'
@@ -1,44 +0,0 @@
1
- # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-05-22 13:23:34 -0700 using RuboCop version 0.30.1.
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: 30
9
- Metrics/AbcSize:
10
- Max: 38
11
-
12
- # Offense count: 3
13
- # Configuration parameters: CountComments.
14
- Metrics/ClassLength:
15
- Max: 200
16
-
17
- # Offense count: 35
18
- # Configuration parameters: CountComments.
19
- Metrics/MethodLength:
20
- Max: 36
21
-
22
- # Offense count: 7
23
- # Configuration parameters: CountKeywordArgs.
24
- Metrics/ParameterLists:
25
- Max: 8
26
-
27
- # Offense count: 9
28
- # Configuration parameters: AllowedVariables.
29
- Style/GlobalVars:
30
- Enabled: false
31
-
32
- # Offense count: 1
33
- # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
34
- Style/Next:
35
- Enabled: false
36
-
37
- # Offense count: 2
38
- # Configuration parameters: Methods.
39
- Style/SingleLineBlockParams:
40
- Enabled: false
41
-
42
- # Offense count: 1
43
- Style/StructInheritance:
44
- Enabled: false
@@ -1,11 +0,0 @@
1
- ## 0.6.1 (2015-04-14)
2
-
3
- ### Changes
4
-
5
- * Begins this ChangeLog ([@tbetbetbe][])
6
- * Updates to version 0.4 of googleauth. ([@tbetbetbe][])
7
- * Switch the extension to use the call API. ([@tbetbetbe][])
8
- * Refactor the C extension to avoid identifiers used by ruby ([@yugui][])
9
-
10
- [@tbetbetbe]: https://github.com/tbetbetbe
11
- [@yugui]: https://github.com/yugui
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in grpc.gemspec
4
- gemspec
data/README.md DELETED
@@ -1,84 +0,0 @@
1
- gRPC Ruby
2
- =========
3
-
4
- A Ruby implementation of gRPC.
5
-
6
- Status
7
- ------
8
-
9
- Alpha : Ready for early adopters
10
-
11
- PREREQUISITES
12
- -------------
13
-
14
- - Ruby 2.x. The gRPC API uses keyword args.
15
- - [homebrew][] on Mac OS X, [linuxbrew][] on Linux. These simplify the installation of the gRPC C core.
16
-
17
- INSTALLATION
18
- ---------------
19
- On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][].
20
- Run the following command to install gRPC Ruby.
21
- ```sh
22
- $ curl -fsSL https://goo.gl/getgrpc | bash -s ruby
23
- ```
24
- This will download and run the [gRPC install script][], then install the latest version of gRPC Ruby gem. It also installs Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin for ruby.
25
-
26
- BUILD FROM SOURCE
27
- ---------------------
28
- - Clone this repository
29
- - Build the gRPC C core
30
- E.g, from the root of the gRPC [Git repository](https://github.com/google/grpc)
31
- ```sh
32
- $ cd ../..
33
- $ make && sudo make install
34
- ```
35
-
36
- - Install Ruby 2.x. Consider doing this with [RVM](http://rvm.io), it's a nice way of controlling
37
- the exact ruby version that's used.
38
- ```sh
39
- $ command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
40
- $ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2
41
- $
42
- $ # follow the instructions to ensure that your're using the latest stable version of Ruby
43
- $ # and that the rvm command is installed
44
- ```
45
- - Make sure your run `source $HOME/.rvm/scripts/rvm` as instructed to complete the set up of RVM
46
-
47
- - Install [bundler](http://bundler.io/)
48
- ```
49
- $ gem install bundler
50
- ```
51
-
52
- - Finally, build and install the gRPC gem locally.
53
- ```sh
54
- $ # from this directory
55
- $ bundle install # creates the ruby bundle, including building the grpc extension
56
- $ rake # runs the unit tests, see rake -T for other options
57
- ```
58
-
59
- DOCUMENTATION
60
- -------------
61
- - rubydoc for the gRPC gem is available online at [rubydoc][].
62
- - the gRPC Ruby reference documentation is available online at [grpc.io][]
63
-
64
- CONTENTS
65
- --------
66
- Directory structure is the layout for [ruby extensions][]
67
- - ext: the gRPC ruby extension
68
- - lib: the entrypoint gRPC ruby library to be used in a 'require' statement
69
- - spec: Rspec unittests
70
- - bin: example gRPC clients and servers, e.g,
71
-
72
- ```ruby
73
- stub = Math::Math::Stub.new('my.test.math.server.com:8080')
74
- req = Math::DivArgs.new(dividend: 7, divisor: 3)
75
- GRPC.logger.info("div(7/3): req=#{req.inspect}")
76
- resp = stub.div(req)
77
- GRPC.logger.info("Answer: #{resp.inspect}")
78
- ```
79
- [homebrew]:http://brew.sh
80
- [linuxbrew]:https://github.com/Homebrew/linuxbrew#installation
81
- [gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
82
- [ruby extensions]:http://guides.rubygems.org/gems-with-extensions/
83
- [rubydoc]: http://www.rubydoc.info/gems/grpc
84
- [grpc.io]: http://www.grpc.io/docs/installation/ruby.html
@@ -1,8 +0,0 @@
1
- Interop test protos
2
- ===================
3
-
4
- These ruby classes were generated with protoc v3, using grpc's ruby compiler
5
- plugin.
6
-
7
- - As of 2015/01 protoc v3 is available in the
8
- [google-protobuf](https://github.com/google/protobuf) repo
@@ -1,89 +0,0 @@
1
- # Copyright 2015, Google Inc.
2
- # All rights reserved.
3
- #
4
- # Redistribution and use in source and binary forms, with or without
5
- # modification, are permitted provided that the following conditions are
6
- # met:
7
- #
8
- # * Redistributions of source code must retain the above copyright
9
- # notice, this list of conditions and the following disclaimer.
10
- # * Redistributions in binary form must reproduce the above
11
- # copyright notice, this list of conditions and the following disclaimer
12
- # in the documentation and/or other materials provided with the
13
- # distribution.
14
- # * Neither the name of Google Inc. nor the names of its
15
- # contributors may be used to endorse or promote products derived from
16
- # this software without specific prior written permission.
17
- #
18
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
-
30
- # Generated by the protocol buffer compiler. DO NOT EDIT!
31
- # source: test/cpp/interop/messages.proto
32
-
33
- require 'google/protobuf'
34
-
35
- Google::Protobuf::DescriptorPool.generated_pool.build do
36
- add_message "grpc.testing.Payload" do
37
- optional :type, :enum, 1, "grpc.testing.PayloadType"
38
- optional :body, :string, 2
39
- end
40
- add_message "grpc.testing.SimpleRequest" do
41
- optional :response_type, :enum, 1, "grpc.testing.PayloadType"
42
- optional :response_size, :int32, 2
43
- optional :payload, :message, 3, "grpc.testing.Payload"
44
- optional :fill_username, :bool, 4
45
- optional :fill_oauth_scope, :bool, 5
46
- end
47
- add_message "grpc.testing.SimpleResponse" do
48
- optional :payload, :message, 1, "grpc.testing.Payload"
49
- optional :username, :string, 2
50
- optional :oauth_scope, :string, 3
51
- end
52
- add_message "grpc.testing.StreamingInputCallRequest" do
53
- optional :payload, :message, 1, "grpc.testing.Payload"
54
- end
55
- add_message "grpc.testing.StreamingInputCallResponse" do
56
- optional :aggregated_payload_size, :int32, 1
57
- end
58
- add_message "grpc.testing.ResponseParameters" do
59
- optional :size, :int32, 1
60
- optional :interval_us, :int32, 2
61
- end
62
- add_message "grpc.testing.StreamingOutputCallRequest" do
63
- optional :response_type, :enum, 1, "grpc.testing.PayloadType"
64
- repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters"
65
- optional :payload, :message, 3, "grpc.testing.Payload"
66
- end
67
- add_message "grpc.testing.StreamingOutputCallResponse" do
68
- optional :payload, :message, 1, "grpc.testing.Payload"
69
- end
70
- add_enum "grpc.testing.PayloadType" do
71
- value :COMPRESSABLE, 0
72
- value :UNCOMPRESSABLE, 1
73
- value :RANDOM, 2
74
- end
75
- end
76
-
77
- module Grpc
78
- module Testing
79
- Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass
80
- SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass
81
- SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass
82
- StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass
83
- StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass
84
- ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass
85
- StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass
86
- StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass
87
- PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
88
- end
89
- end
@@ -1,60 +0,0 @@
1
- # Copyright 2015, Google Inc.
2
- # All rights reserved.
3
- #
4
- # Redistribution and use in source and binary forms, with or without
5
- # modification, are permitted provided that the following conditions are
6
- # met:
7
- #
8
- # * Redistributions of source code must retain the above copyright
9
- # notice, this list of conditions and the following disclaimer.
10
- # * Redistributions in binary form must reproduce the above
11
- # copyright notice, this list of conditions and the following disclaimer
12
- # in the documentation and/or other materials provided with the
13
- # distribution.
14
- # * Neither the name of Google Inc. nor the names of its
15
- # contributors may be used to endorse or promote products derived from
16
- # this software without specific prior written permission.
17
- #
18
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
-
30
- # Generated by the protocol buffer compiler. DO NOT EDIT!
31
- # Source: test/cpp/interop/test.proto for package 'grpc.testing'
32
-
33
- require 'grpc'
34
- require 'test/cpp/interop/test'
35
-
36
- module Grpc
37
- module Testing
38
- module TestService
39
-
40
- # TODO: add proto service documentation here
41
- class Service
42
-
43
- include GRPC::GenericService
44
-
45
- self.marshal_class_method = :encode
46
- self.unmarshal_class_method = :decode
47
- self.service_name = 'grpc.testing.TestService'
48
-
49
- rpc :EmptyCall, Empty, Empty
50
- rpc :UnaryCall, SimpleRequest, SimpleResponse
51
- rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse)
52
- rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse
53
- rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
54
- rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
55
- end
56
-
57
- Stub = Service.rpc_stub_class
58
- end
59
- end
60
- end
@@ -1,40 +0,0 @@
1
- # -*- ruby -*-
2
- # encoding: utf-8
3
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
4
- require 'grpc/version'
5
-
6
- Gem::Specification.new do |s|
7
- s.name = 'grpc'
8
- s.version = GRPC::VERSION
9
- s.authors = ['gRPC Authors']
10
- s.email = 'temiola@google.com'
11
- s.homepage = 'https://github.com/google/grpc/tree/master/src/ruby'
12
- s.summary = 'GRPC system in Ruby'
13
- s.description = 'Send RPCs from Ruby using GRPC'
14
- s.license = 'BSD-3-Clause'
15
-
16
- s.required_ruby_version = '>= 2.0.0'
17
- s.requirements << 'libgrpc ~> 0.10.0 needs to be installed'
18
-
19
- s.files = `git ls-files`.split("\n")
20
- s.test_files = `git ls-files -- spec/*`.split("\n")
21
- s.executables = `git ls-files -- bin/*.rb`.split("\n").map do |f|
22
- File.basename(f)
23
- end
24
- s.require_paths = ['lib']
25
- s.platform = Gem::Platform::RUBY
26
-
27
- s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1'
28
- s.add_dependency 'googleauth', '~> 0.4' # reqd for interop tests
29
- s.add_dependency 'logging', '~> 2.0'
30
- s.add_dependency 'minitest', '~> 5.4' # reqd for interop tests
31
-
32
- s.add_development_dependency 'simplecov', '~> 0.9'
33
- s.add_development_dependency 'bundler', '~> 1.9'
34
- s.add_development_dependency 'rake', '~> 10.4'
35
- s.add_development_dependency 'rake-compiler', '~> 0.9'
36
- s.add_development_dependency 'rspec', '~> 3.2'
37
- s.add_development_dependency 'rubocop', '~> 0.30.0'
38
-
39
- s.extensions = %w(ext/grpc/extconf.rb)
40
- end