0

I have a dataset of about 1-10k records, each has a ticking timer associated with it. I'd like to be able to query it in a way that it surfaces the data which has passed a certain time limit.

Here's an example:

  • [obj1] [2sec]
  • [obj2] [3sec]
  • [obj3] [2sec]
  • [obj4] [5sec]
  • [obj5] [7sec]
  • [obj6] [3sec]
  • [obj7] [2sec]

After 2 seconds, I'd like this data structure to surface out obj1, obj3 and obj7. After 1 more second, the data structure with surface out obj2 and obj 6, and so on...

Sidenote, is there a way to do this via Redis?

Thank you for your help in advance...

  • In-memory, I would use a structure like a DelayQueue (https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/DelayQueue.html). Implementing it in Redis is another problem. – Welbog Oct 24 '22 at 12:10

0 Answers0