-
Notifications
You must be signed in to change notification settings - Fork 592
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
logging: use gRPC #1134
logging: use gRPC #1134
Conversation
11e431d
to
b4c119d
Compare
/cc @jayantkolhe |
On the gRPC side, we are working on static Node.js code generation using This will have a different API than the current dynamically generated code does: instead of passing and receiving bare JavaScript objects, users will build and use objects defined in protobuf-specific classes. This will allow for more immediate and informative input type-checking, and it will be more consistent with other languages. As a side note, gRPC doesn't see |
Thanks! I'm sorry to have to admit, but I'm not quite sure where to begin to realize that vision. Is there any documentation, example code, guides, or reading material you can point me to? |
The pull request protocolbuffers/protobuf#1215 contains a significant update to JavaScript protobuf code generation and documentation, so that is probably a good place to start. |
So does this sound right:?
|
More accurately:
Regarding the API change: currently, the objects you pass as arguments and receive as responses in Node gRPC are regular JavaScript objects that are converted on the fly to or from ProtoBuf.js Message objects. With this new generated code, users will instead pass in and receive protobuf Message objects of the relevant types. |
Thanks for clearing that up.
Can't mismatched input types from a plain JavaScript object be caught by gRPC at runtime? |
It can, but currently that check is done when the message is written. If we require users to pass protobuf Message objects, they will get that type checking when they are building the message objects. |
In our case, those events will be in succession, since I think we want to continue to allow plain objects as input for our API. Our library would have to do a lot of plumbing just to convert those objects to Message objects, so having that handled for us has been quite a help. |
@murgatroid99 is there a PR or issue I can subscribe to for the protoc plugin that generates service files? |
The issue is at grpc/grpc#5418 |
I'm going to move forward with the goal of getting this released as-is before the end of the month. After that, we'll iterate where necessary to align with the best practices around gRPC. |
I have a PR for this at grpc/grpc#5189. I believe I can have this complete and submitted within the next few days; definitely by the end of the week. |
Sorry if I'm just missing the connection, but did you mean grpc/grpc#5445? |
Yes, that's right. That was just a copy/paste error |
2975a8a
to
10a1480
Compare
I'm subscribed to that one, so I'll be sure to follow along and make the updates here when the PR is merged and a new release is cut. For now, @callmehiphop PTAL! |
@@ -244,9 +265,9 @@ GrpcService.prototype.request = function(protoOpts, reqOpts, callback) { | |||
* @param {*} data - An object or array to iterate over. | |||
* @return {*} - The converted object. | |||
*/ | |||
GrpcService.prototype.convertBuffers_ = function(data) { | |||
GrpcService.convertBuffers_ = function(data) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@stephenplusplus aside from the |
10a1480
to
a749f6f
Compare
RE: #1049
This transitions our Logging API to use gRPC.
To Dos
- log.createWriteStream();
Writing to a log from a stream is gone. gRPC (the library) doesn't see
WriteLogEntries
as a stream.