-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add example #35
base: add-example
Are you sure you want to change the base?
Add example #35
Conversation
Congratz on completing your first end-to-end test =). Would you mind adding the |
Oops. I have checked in and pushed to the branch. Do you want another pull request?
Eoin
…Sent from my mobile phone
On 14 Jun 2020, at 20:13, dicioccio lucas ***@***.***> wrote:
Congratz on completing your first end-to-end test =).
Would you mind adding the .proto interface?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
No need for a new-pull request as long as you push to the same remote/branch ! Thanks for adding the protos. I'll soon merge this branch after another review. Then, I'll do one pass on the overall structure before merging the |
I've added some comments, if you feel it's too much work or if there are things unclear ping me and we can get through the comments together. I'm thinking about one improvement (I don't mind pairing with you for adding this) is to have one (or two) executables for running the examples. Also, once we have the executables we should build these inside the CI jobs but then this is again another story. |
HI .. I was planning to add binary executables anyway, so fine with that. I should be good to do that on my own. Can't see specific comments in the PR code. Am I being dense? |
} | ||
``` | ||
|
||
Each RPC call takes a single message, and returns a single message. In this case the request is a *CalcNumbers* and the response is a *CalcNumber*. Protobuf allows message types to be nested. In this case *CalcHumbers* is comprised of a list of *CalcNumber* values. *CalcNumber* itself is a [32 bit unsigned int](https://developers.google.com/protocol-buffers/docs/proto3#scalar_value_types). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/CalcHumbers/CalcNumbers
Each RPC call takes a single message, and returns a single message. In this case the request is a *CalcNumbers* and the response is a *CalcNumber*. Protobuf allows message types to be nested. In this case *CalcHumbers* is comprised of a list of *CalcNumber* values. *CalcNumber* itself is a [32 bit unsigned int](https://developers.google.com/protocol-buffers/docs/proto3#scalar_value_types). | ||
|
||
# Getting it working | ||
The *calcs.proto* definition file is used to generate Haskell code via the *protoc* tool, which needs to be installed separately. There are two Haskell files generated. The simplest way to build the client and server is to copy these generaeted source files to somewhere accessible within your stack package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you should say in this paragraph at this point is:
- this repository contains the generated Haskell code. Thus, the example requires no specific tooling not code-generation steps.
- however we encourage users to try re-generating the code to practice this step
- the code-generation requires to install
protoc
andproto-lens-protoc
separately. Both binaries must be on the PATH before invokingprotoc
# Getting it working | ||
The *calcs.proto* definition file is used to generate Haskell code via the *protoc* tool, which needs to be installed separately. There are two Haskell files generated. The simplest way to build the client and server is to copy these generaeted source files to somewhere accessible within your stack package. | ||
|
||
## Starting the Server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you need to say "in an interactive session" because you use ghci
below
someFunc' [] | ||
~~~ | ||
|
||
This starts the server on port 3000. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add something about the fact that the server runs waiting for client queries (and hence does not give the prompt back).
~~~ | ||
stack ghci | ||
:l ArithServer | ||
someFunc' [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename the function to something more "user friendly" like runExampleServer
|
||
~~~ | ||
stack ghci | ||
ArithClient.main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above,
maybe rename the function to something more "user friendly" like runExampleClient
Sorry about the comment not show. They appeared on my view but I had to press a "submit review" button. Which is new to me (I'm more used to GitLab review system). Sorry about the delay. |
Thanks. Have been swamped last couple of days. Will look
Eoin
…Sent from my iPad
On 17 Jun 2020, at 20:19, dicioccio lucas ***@***.***> wrote:
Sorry about the comment not show. They appeared on my view but I had to press a "submit review" button. Which is new to me (I'm more used to GitLab review system). Sorry about the delay.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
What still needs to be done with this? I'm trying to orient myself to this library right now as I need gRPC for what I'm doing and I'm having a difficult time doing so. I imagine that this PR with an example could help people like me. It seems from the comment stream that this is mostly ready to go save for some polish. I'd love to help but I don't think I can push to the fork branch. |
Initial merge of a simple arithmetic server.