Skip to content

Conversation

@glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Sep 27, 2019

Motivation:

a30043a (#590) introduced a 'Hello World' example and tutorial to help
new gRPC Swift users. A more in-depth tutorial would be useful as a
next-step for those users.

Modifications:

Add a tutorial based on the "route guide" service as per
https://grpc.io/docs/tutorials/

Move parts of the README.md into separate documenation files in docs/

Result:

  • Another gRPC tutorial
  • Easier to find documenation

Motivation:

a30043a (grpc#590) introduced a 'Hello World' example and tutorial to help
new gRPC Swift users. A more in-depth tutorial would be useful as a
next-step for those users.

Modifications:

Add a tutorial based on the "route guide" service as per
https://grpc.io/docs/tutorials/

Move parts of the `README.md` into separate documenation files in `docs/`

Result:

- Another gRPC tutorial
- Easier to find documenation
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 27, 2019

CLA Check
One or more committers are not authorized under a signed CLA as indicated below. Please click here to be authorized.

@glbrntt glbrntt requested a review from MrMage September 27, 2019 16:16
Copy link
Collaborator

@MrMage MrMage left a comment

Choose a reason for hiding this comment

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

Great codelab! Are there plans to link to all the docs from one central location?

}

extension ClientCall {
public func waitForCompletion(errorCallback: (GRPCStatus) -> Void = { _ in }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the advantage of this method over try wait()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops -- I didn't mean to commit this. I was playing around with ideas because waiting on the GRPCStatus can be a bit of a pain: even though we guarantee that it will never fail (i.e. try! status.wait() should not fail) it's something that users have to trust and is absolutely a code-smell.

Also when the future is completed the user has to switch on the status code to check whether it's .ok or not. So there's actually quite a lot of boilerplate required to check the outcome of the call.

Not sold on any solution yet but I've been thinking that a never-failing future would be helpful (i.e. you would recover or similar into something with no .failure branch), as would futures with a particular error type (i.e. like Result).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds like we should revert this here and file an issue for a better future solution :-)


- `Routeguide_Point`: the request
- `StatusOnlyCallContext`: a context which exposes status and trailing metadata
objects.
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/objects/promises that you can fulfill/?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They're not EventLoopPromises: "objects that you can update"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, my mistake. How about "a context which exposes status and trailing metadata
fields that you can change if needed."?

@glbrntt
Copy link
Collaborator Author

glbrntt commented Sep 30, 2019

Great codelab! Are there plans to link to all the docs from one central location?

I spoke to @timburks a little while ago about getting gRPC Swift included on https://grpc.io -- so hopefully there!

@MrMage
Copy link
Collaborator

MrMage commented Sep 30, 2019

I spoke to @timburks a little while ago about getting gRPC Swift included on https://grpc.io -- so hopefully there!

Hmm, how about linking to them from README.md as well?

@glbrntt
Copy link
Collaborator Author

glbrntt commented Sep 30, 2019

I spoke to @timburks a little while ago about getting gRPC Swift included on https://grpc.io -- so hopefully there!

Hmm, how about linking to them from README.md as well?

Already done in this PR!

@glbrntt glbrntt merged commit 0df475f into grpc:nio Sep 30, 2019
@glbrntt glbrntt deleted the gb-routeguide branch September 30, 2019 11:10
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