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

examples: add client example for tonic-reflection #1601

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

grottohub
Copy link

This adds an example usage of the ServerReflectionClient using a ListServices request.

Fixes: #1600

Motivation

Took awhile to figure out how to set up the reflection client, so thought I would provide an example.

Solution

This example includes everything needed to communicate with a server providing reflection:

  • setting up the client with an Endpoint (since the codegen doesn't provide the connect method most clients have as transport is an optional feature for tonic-reflection)
  • configuring a ServerReflectionRequest using one of the provided MessageRequest options
  • putting the request into a stream since reflection is a bidi-streaming procedure
  • parsing the response received from the server

This adds an example usage of the `ServerReflectionClient` using
a `ListServices` request.

Fixes: hyperium#1600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an example client to the reflection example
2 participants