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

Feature request: In-process transport #704

Closed
Daniel15 opened this issue Dec 25, 2019 · 4 comments
Closed

Feature request: In-process transport #704

Daniel15 opened this issue Dec 25, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@Daniel15
Copy link

Daniel15 commented Dec 25, 2019

Is your feature request related to a problem? Please describe.

I have an ASP.NET Core site that connects to 10 or so different instances of the same gRPC service, deployed across several servers.

One of the instances will be running on the local machine. In this case, I'd like to have both the server and the client hosted in a single app, and the ability to perform an "in-process" gRPC call, for example where the client directly instantiates an instance of the server. This would avoid TCP overhead, and Protobuf serialization/deserialization overhead (as the client could pass the Protobuf instances directly to the server instance).

Describe the solution you'd like

As above. I imagine this could be implemented by making the transport pluggable instead of hard-coding it to use HttpClient.

Additional context

@Daniel15 Daniel15 added the enhancement New feature or request label Dec 25, 2019
@Daniel15 Daniel15 changed the title In-process transport Feature request: In-process transport Dec 25, 2019
@davidfowl
Copy link
Contributor

As above. I imagine this could be implemented by making the transport pluggable instead of hard-coding it to use HttpClient.

The transport is pluggable today but GRPC requires HTTP/2 which is implemented in HttpClient https://github.com/dotnet/corefx/issues/35404

@Daniel15
Copy link
Author

Daniel15 commented Dec 25, 2019

GRPC requires HTTP/2 which is implemented in HttpClient

Requiring HTTP means you're always going to have the protobuf serialization/deserialization overhead, which is less than ideal as it should be unnecessary for something in-proc. Do you really need HTTP for communication within the same process? It should be possible to just use method calls.

I wonder how the Java library does it.

@JamesNK
Copy link
Member

JamesNK commented Dec 25, 2019

Java doesn’t serialize the messages, but that works for Java because their generated messages are immutable.

I doubt we’ll support that style of inproc, at least in the short/medium term. It would require rewriting the client and server. However, there is nothing stopping someone else writing a client CallInvoker that directly calls a service.

grpc-dotnet inproc will use a HttpClient + memory transport. The client and server will still use HTTP/2, but can call the Kestrel server without any TCP overhead.

@JamesNK
Copy link
Member

JamesNK commented Dec 28, 2019

Closing as duplicate of #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants