-
Notifications
You must be signed in to change notification settings - Fork 22
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
Metadata v.s OneOf : which is better? #96
Comments
Does it make sense to follow similar protocol as S3 multipart upload requests? Would it be easier than streams? https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html That said, I think it is okay to keep metadata in each stream message (no need for oneof) since it is just a small price to pay to make the processing easy. |
I personally think there is no better choice, these two designs have it's own pros and cons: Use metadata
Use
|
TypeScript code for using
|
@lhr0909 @windmemory Thank you very much for sharing the great opinions on this important topic! Finally, we will go with the Cheers! |
After we found that the @chatie/grpc < 0.18 has a problem that it will send big (i.e. 100MB) files in the gRPC request directly, which will block the Node.js event loop (wechaty/puppet-service#80), we decided to use a grpc stream service to solve this problem. (#90)
However, the gRPC streaming services can only have a single parameter, which makes us have to find a way to pass more parameters when we are using a stream request.
There are two options for that:
metadata
with the gRPC call. It is clean and simple, however, it does not support static typing. (see Let's remove the extra info inside stream message #94)oneof
in ProtoBuffer. It will be able to support static typing, however, it makes the stream complicated. (see GRPC Stream tools for FileBox windmemory/repro-grpc-bug#1)To be decided.
Appendix
The text was updated successfully, but these errors were encountered: