LRUcache: Create an LRU in-memory cache

Description Usage Arguments Details

View source: R/lru.R

Description

LRU stands for Least Recently Used and is a description of a cache eviction strategy. In simpler words, this means that you can set a size limit and the cache will smartly forget about the item that was accessed last in case you need to add another item which would cause the cache to breach the memory or size constraint.

Usage

1
LRUcache(params)

Arguments

params

numeric or character. If numeric it will create a cache that's limited by the total number of objects it can hold. If it's a character it will check how much RAM it consumes using pryr::object_size

Details

You can use cacher either by calling LRUcache(3) to store maximum 3 objects or calling LRUcache("150mb") to limit the cache size to not exceed 150mb of RAM.


kirillseva/cacher documentation built on May 20, 2019, 10:23 a.m.