Alright here's the trickiest question I've ever had to ask on StackOverflow.
My Web App allows creating a document. This document is automatically saved lets say ever couple of seconds.
Meanwhile, I want a news feed to lets users know what there friends are up to. So I created a observer model which after_create creates a news_feed type item.
Problem is this observer as is now will create a news_feed on ever save which is a huge firehose.
So I want to make it so the news_feed for this model is only injects per session or every X minutes. So I added a last_feeded_at column to the model.
Problem is when I try to update that field in the observer to mark it was feeded, that triggers the observer, which makes a mess of everything.
What's the best way to handle this? I'm open to all smart suggestions.
Thanks