3 ms·
I think I understand your problem. When applying an event, how do you know whether it’s an event that just happened now, or something you’re playing back from m
by blowski 8y ago
I think I understand your problem. When applying an event, how do you know whether it’s an event that just happened now, or something you’re playing back from months ago?
One solution I implemented was to log all of the ‘reactions’. Then when reacting, I checked whether the reaction had already happened to prevent side effects. For example:
if !reactionLog.happened(reaction)
sendEmail()
reactionLog.log(reaction)
Admittedly, this was a system used by only 200 people and performance wasn’t too much of a concern. Also, if ‘sendEmail()’ has side effects, they won’t happen.