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

grpc-java channel similars in grpc-go #187

Closed
hongchaodeng opened this issue May 6, 2015 · 4 comments
Closed

grpc-java channel similars in grpc-go #187

hongchaodeng opened this issue May 6, 2015 · 4 comments

Comments

@hongchaodeng
Copy link

Hi, @iamqizhao

Sorry to raise the old issue again. I think I understand the problem better. We actually want something like what grpc-java channel provides:

https://github.com/grpc/grpc-java#channel

This is very useful for framework developers.

Basically, the framework should be agnostic to message definition by user. It needs to handles the low level details, e.g. creating connection, finding address, flow control.

Ultimately, some generic client method calls is wanted

Client.Call( methodName, input message)

And interceptor method on server side

Intercept( methodName, input )

Can you think about it and let me know your thoughts?

@iamqizhao
Copy link
Contributor

I still do not understand why you require an interceptor ... It was deliberate to abandon interceptor in our design.

@hongchaodeng
Copy link
Author

NP. Let me try to explain better.

In TCP socket, we send bytes:

send(b []byte)

Now that we have protobuf and grpc, we want to send messages instead.

send(msg proto.Message)

The send(msg) API is provided by the framework, and message should be defined by user.

I wonder how can we do it efficiently without letting user define msg/rpc on their own?

@iamqizhao
Copy link
Contributor

pls tell me how interceptors can help you address this issue?

We typically provide send(b []byte) to users instead of send(proto.Message)
which provides more flexibility and the framework should not care what
users will to transmit.

If you are thinking about the encoding efficiency (e.g., memory alloc and
string copying), I think it is the work of protobuf should take care of.
And I guess it is doable but it does not do because it will introduce
tremendous complexity regarding memory model.

On Mon, May 11, 2015 at 1:55 PM, Hongchao Deng notifications@github.com
wrote:

NP. Let me try to explain better.

In TCP socket, we send bytes:

send(b []byte)

Now we have protobuf and grpc, we want to send messages instead.

send(msg proto.Message)

The send(msg) API is provided by the framework, and message should be
defined by user.

I wonder how can we do it efficiently without letting user define msg/rpc
on their own?


Reply to this email directly or view it on GitHub
#187 (comment).

@iamqizhao
Copy link
Contributor

I guess calling Invoke(...) directly can fit your needs?

@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants