Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Reflection Problem #13

@sleipnir

Description

@sleipnir

Server Reflection is a gRPC feature that allows ‘dynamic’ clients, such as command-line tools for debugging, to discover the protocol used by a gRPC server at run time. They can then use this metadata to implement things like completion and sending arbitrary commands.

However, for the proxy that implements the CloudState protocol, it goes a little further by making the proxy capable of creating an implementation based on the client services specification (user functions). For this reason I consider reflection to be two items to be implemented:

  • Classic gRPC Reflection
  • Dynamic implementation of gRPC services based on the client definition.

For the first item we have to consider implementing the following issue:
elixir-grpc/grpc#148

For the second item, we have to implement the following steps:

1 - Create the FileDescriptor from what arrived at EntityDiscovery
2 - Use the internal apis of the elixir protobuf library to generate the source code of the Elixir modules of these Protos.
3 - Compile these codes with Code.compile_string or compile_file
4 - Dynamically generate the module with the client's gRPC implementation, something like

defmodule Mongoose.ModuleName 
use GRPC.Server, service: ServiceNameHere 
    // define the calling method here, this method should call a Mongoose handler, that is, it is just a facade 
end

5 - Create the module with the Endpoint (or leave a pre-defined module that injects the endpoints via metaprogramming)
6 - Compile the generated module
7 - Bootstrap the entire gRPC code over your own supervision tree.

Task implementation Index:

  • Classic gRPC Reflection
  • Dynamic implementation of gRPC services based on the client definition.
    • Create the FileDescriptor from what arrived at EntityDiscovery
    • Use the internal apis of the elixir protobuf library to generate the source code of the Elixir modules of these Protos.
    • Compile these codes with Code.compile_string or compile_file
    • Dynamically generate the module with the client's gRPC implementation,
    • Create the module with the Endpoint (or leave a pre-defined module that injects the endpoints via metaprogramming)
    • Compile the generated module
    • Bootstrap the entire gRPC code over your own supervision tree.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions