You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that GPB Messages are essentially structured records. But, the grpc generates erlang files (from proto files) which uses maps. Is there a way we can generate record format for messages?
The main advantage I can see is,
I can include the generated header file in other Erlang modules and we have a handy way of generating messages.
Also, if protobuf initializes some members of a message to default values, records could have been initialized to those default values as well, thereby caller need not worry filling in those fields. If it were maps, the caller needs to populate every possible member of message or else, I could get a runtime exception when invoking a service which is using that Message.
I could take the help of an editor to populate record fields for auto-completing record names or field names. Thereby code is less prone to typos.
If I can generate a record with existing code, can you please point me to an example on how to do that?
Thanks
-Vasu
The text was updated successfully, but these errors were encountered:
Hi,
This is more of a question than an issue.
I see that GPB Messages are essentially structured records. But, the grpc generates erlang files (from proto files) which uses
maps
. Is there a way we can generaterecord
format for messages?The main advantage I can see is,
protobuf
initializes some members of a message to default values, records could have been initialized to those default values as well, thereby caller need not worry filling in those fields. If it were maps, the caller needs to populate every possible member of message or else, I could get a runtime exception when invoking a service which is using that Message.If I can generate a record with existing code, can you please point me to an example on how to do that?
Thanks
-Vasu
The text was updated successfully, but these errors were encountered: