Skip to content

Improved client example with all request types#25

Open
DaniGuardiola wants to merge 3 commits intonameko:masterfrom
DaniGuardiola:patch-1
Open

Improved client example with all request types#25
DaniGuardiola wants to merge 3 commits intonameko:masterfrom
DaniGuardiola:patch-1

Conversation

@DaniGuardiola
Copy link
Copy Markdown

No description provided.

@DaniGuardiola DaniGuardiola changed the title Fixed typo in standalone client example Improved client example with all request types Jun 10, 2019
Comment thread README.md
for response in responses:
print(response.message)
response_messages.append(response.message)
print("responses: ", " | ".join(response_messages)) # aaaaa | bb | cccccccc
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants