22 Apr
2015
22 Apr
'15
5:10 a.m.
On Wednesday, April 22, 2015 12:22 PM, Lane wrote:
I like the idea of using a circular_buffer, but still not sure how to time the data on this buffer. I'd like for objects on this buffer to be removed after n seconds, and not based on fixed capacity where they get over-written. Or did I misunderstand? I think somehow attaching a timer to each and every object on this buffer is the part I'm having trouble with efficiently.
I don't think you need to remove them after n seconds, you just need to not read entries older than n seconds, so perhaps store the data with a timestamp, and then clean up or ignore old entries during the read. Ben