Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby: add the code generated from reflection.proto #24210

Conversation

south37
Copy link
Contributor

@south37 south37 commented Sep 22, 2020

Ref

#2567

Why

Sometimes we want to use gRPC Server Reflection in Ruby.

What

This PR adds the code generated from reflection.proto.

  • src/ruby/pb/grpc/reflection/v1alpha/reflection_pb.rb
  • src/ruby/pb/grpc/reflection/v1alpha/reflection_services_pb.rb

By this change, we can use reflection feature in Ruby.

[1] pry(main)> require 'grpc/reflection/v1alpha/reflection_services_pb'
=> true
[2] pry(main)> Grpc::Reflection::V1alpha.constants
=> [:ErrorResponse,
 :ServerReflection,
 :ServerReflectionRequest,
 :ServerReflectionResponse,
 :ExtensionRequest,
 :FileDescriptorResponse,
 :ExtensionNumberResponse,
 :ListServiceResponse,
 :ServiceResponse]
[3] pry(main)> Grpc::Reflection::V1alpha::ServerReflectionRequest.new
=> <Grpc::Reflection::V1alpha::ServerReflectionRequest: host: "", file_by_filename: "", file_containing_symbol: "", file_containing_extension: nil, all_extension_numbers_of_type: "", list_services: "">
require 'grpc/reflection/v1alpha/reflection_services_pb'

class ReflectionService < Grpc::Reflection::V1alpha::ServerReflection::Service
  def server_reflection_info(requests, call)
    # Implement reflection feature here.
  end
end

I also updated src/ruby/pb/generate_proto_ruby.sh, which seems to be a utility script for code generation in Ruby.

@nicolasnoble

@stale
Copy link

stale bot commented Jan 17, 2021

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@stale stale bot closed this Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants