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

Add Handler method to pass in client #454

Merged
merged 2 commits into from
Oct 4, 2017

Conversation

jacksontj
Copy link
Contributor

Right now if you want to embed the JSON proxy into your service you end
up having to have a client talking to loopback which is messy. With this
API addition you can simply pass in something which implements the
client interface -- meaning you could wrap it yourself and return
directly (without all the loopback and serialization overhead).

@jacksontj
Copy link
Contributor Author

cc @tmc (seem to be attached to a lot of recent commits)

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@jacksontj
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@tmc
Copy link
Collaborator

tmc commented Sep 14, 2017

Thanks for your contribution! master has a build system fix, can you please rebase this?

@jacksontj
Copy link
Contributor Author

@tmc done, and I added a commit to regenerate the examples (which makes CI pass)

@achew22
Copy link
Collaborator

achew22 commented Sep 17, 2017

@tmc this looks good to me. Feel free to rebase and merge

@iluminae
Copy link

so this is fantastic and is an obvious advantage over making the TCP call over loopback to achieve the same functionality - but may I bring up that using this bypasses grpc interceptors and stats handlers - which at least some of us use for authentication. (like this guy suggests: http://mycodesmells.com/post/authentication-in-grpc)

Should we open another issue for how to support grpc constructs using this direct call method? Or, is this meant for those not using grpc featurettes like interceptors?

@achew22
Copy link
Collaborator

achew22 commented Sep 27, 2017

@iluminae brings up a very good point. Could you at a minimum expand upon this downside in the documentation for this new method?

@jacksontj
Copy link
Contributor Author

@achew22 I've added some documentation clarifying, let me know if that isn't clear enough (and if not, how to change it ;) )

@achew22
Copy link
Collaborator

achew22 commented Oct 3, 2017

LGTM. once the tests pass let's merge this

Right now if you want to embed the JSON proxy into your service you end
up having to have a client talking to loopback which is messy. With this
API addition you can simply pass in something which implements the
client interface -- meaning you could wrap it yourself and return
directly (without all the loopback and serialization overhead).
@jacksontj
Copy link
Contributor Author

Forgot to regen the examples, just did-- this run should pass.

@achew22 achew22 merged commit c323909 into grpc-ecosystem:master Oct 4, 2017
adasari pushed a commit to adasari/grpc-gateway that referenced this pull request Apr 9, 2020
* Add Handler method to pass in a client

Right now if you want to embed the JSON proxy into your service you end
up having to have a client talking to loopback which is messy. With this
API addition you can simply pass in something which implements the
client interface -- meaning you could wrap it yourself and return
directly (without all the loopback and serialization overhead).

Note that this does not apply interceptors and other gRPC
niceties. Please ensure your application doesn't need
interceptors before using this method.
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.

5 participants