Class: CacheWithLoad

CacheWithLoad(evictPolicy, capacity, maxLoad, eqComparer)

A CacheWithLoad introduces a second concept to constrain the capacity of it. This second concept of load is useful for when the size of the items to cache is not known, and when the sheer amount of items does not allow to estimate the load. The CacheWithLoad evicts items when either its capacity is exhausted or the maximum load is exceeded.

Constructor

new CacheWithLoad(evictPolicy, capacity, maxLoad, eqComparer)

Parameters:
Name Type Description
evictPolicy EvictionPolicy | Number
capacity Number
maxLoad Number The maximum load, expressed as a positive number.
eqComparer EqualityComparer.<TVal>
Author:
Source:

Members

_dict :Object.<(String|Symbol), CacheItemWithLoad.<T>>

Type:
Source:

Methods

set(load)

Parameters:
Name Type Description
load *
Source: