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

Improved client example with all request types #25

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

Improved client example with all request types #25

wants to merge 3 commits into from

Conversation

DaniGuardiola
Copy link

No description provided.

@DaniGuardiola DaniGuardiola changed the title Fixed typo in standalone client example Improved client example with all request types Jun 10, 2019
for response in responses:
print(response.message)
response_messages.append(response.message)
print("responses: ", " | ".join(response_messages)) # aaaaa | bb | cccccccc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for expanding these.

Can you perhaps move them to the block above (the nameko service client)? Otherwise it looks like the standalone client has special abilities, whereas it's really just a different usage.

Also I wonder whether using the @rpc decorator in that example is confusing, since it's so close to @grpc. It might be better to use @http or something obviously different.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I wonder whether using the @rpc decorator in that example is confusing, since it's so close to @grpc. It might be better to use @http or something obviously different.

I would include examples for both, it makes it clearer.

@DaniGuardiola
Copy link
Author

Examples structure now:

  • Service client
    • @rpc method
      • unary-unary
      • unary-stream
    • @http method
      • stream-unary
  • Standalone client
    • stream-stream

This way the four types of request-responses are covered, with both rpc and http method examples in the service client.

I'm thinking we could even include an example of gRPC service client, to show all options (and move one of the req-res types there, given that the rpc example has two).

@mattbennett
Copy link
Member

@DaniGuardiola this is great, thanks. So per your final suggestion the example structure would be this?

  • Service client
    • @rpc method
      • unary-unary
    • @grpc method
      • unary-stream
    • @http method
      • stream-unary
  • Standalone client
    • stream-stream

I like it!

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.

None yet

2 participants