Hi, is there a First In First Out collection in Kotlin which we can set a limited size ?
g
Giorgos Makris
07/29/2022, 12:44 PM
Have you looked into buffered `Channel`s? Not exactly a collection but it could be better. Otherwise you could try something like this but with an array implementation
in the documentation, maybe it's what I need ? It's for storing little data classes with 100 maximum items to keep RAM consuption small
👍 1
s
Shawn
07/29/2022, 2:46 PM
ArrayDeque is definitely what I’d use instead of the older Queue or LinkedList classes to implement this, but I don’t think there are any stdlib data structures with a capacity-based eviction policy built in