I have to admit that I'm not very familiar with the protocol buffers API for Python, so hopefully someone more knowledgeable can chime in. But given that Python does not have a message differencer, I think your best bet would be to try to use the reflection API to implement something similar. It should allow you to iterate over the fields for a particular message type and check for differences between two protos. On this page <https://developers.google.com/protocol-buffers/docs/pythontutorial> under "Advanced Usage" there are some hints about how to do this.
On Thu, Sep 15, 2016 at 10:16 AM, Jordan Kaye <[email protected]> wrote: > Hello all, > > I've been searching for the better part of a day without finding much > information on this topic, so I figured I'd go ahead and ask here. > > I'm looking for a way to receive notifications of changes to individual > Protobuf message instances. I have an application that would like to > persist the changes of a message through time (event sourcing), and it > would make things extremely clean if there were some way to accomplish this. > > If I were working in C++, it seems that there would at least be the > possibility of using the message differencer for this (I could copy a > message before applying some logic to it then run the differencer on the > the copy and the message after the modification), but the code that I > currently have is in Python. > > I understand that this is probably a very specific use case, but is there > any way for me to achieve something like this? > > Thanks, > Jordan > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
