Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/velo/src/cache/base.ts>BaseCache

A high-performance caching library for Deno. Supports LRU, LFU, ARC, and TinyLFU.
Latest
class BaseCache
implements Cache<K, V>
import { BaseCache } from "https://deno.land/x/velo@1.0.0/src/cache/base.ts";

The base cache class that all capability wrappers extend.Since it will be the "most inner" cache, these methods will only becalled if not overwritten by any capability wrapper. If a method of this class is reached, it will throw an error.

Properties

readonly
capacity: number
readonly
events: EventEmitter
readonly
keys: K[]
readonly
options: Options<K, V>
readonly
size: number
readonly
stats: CacheStatistics
readonly
values: V[]

Methods

erase(_key: K): void
forEach(_callback: (item: { key: K; value: V; }, index?: number | undefined) => void): void
get(_key: K): V | undefined
has(_key: K): boolean
peek(_key: K): V | undefined
remove(_key: K): void
reset(): void
set(_key: K, _value: V): void
setWithExpire(
_key: K,
_value: V,
_expire: number,
): void
take(_key: K): V | undefined