vtprotobuf icon indicating copy to clipboard operation
vtprotobuf copied to clipboard

Call Reset before UnmarshallVT to keep the default grpc semantic

Open aureliar8 opened this issue 2 years ago • 2 comments

Fixes #128

Contrary to what was discussed in the issue, I was not able to call ResetVT() before UnmarshallVT() because the reset method isn't always generated (it's only generated when the pool option is enabled)

Perhaps the ResetVT() method should also be generated when the unmarshal feature is enabled ?

aureliar8 avatar Feb 02 '24 08:02 aureliar8

You should do the same trick as the code does to detect the MarshalVT method - use an interface that declares ResetVT and see if the type implements that interface. That way you don't have to depend on protobuf.

bhollis avatar Mar 18 '24 19:03 bhollis

In addition to @bhollis's comment I'd suggest to extract ResetVT generation from pool under a new option reset.

fenollp avatar May 18 '24 09:05 fenollp