Is there a way in Java to create a List
implementation that has a timeout/eviction policy for items contained in the list? Something along the lines of:
List<SomeObject> myList = new TimeoutList<>(10, TimeUnit.SECONDS);
so that items entered into the list will be automatically evicted after the given time. I know about the Guava Cache, but a cache is a Map
and will not maintain the order of the items entered.