Skip to content

ILRUCache<T>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / ILRUCache

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3013

LRU cache interface

T = SingleProof

get(key): Promise<CacheLookupResult<T>>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976

Get an entry from the cache

string | CacheKey

Promise<CacheLookupResult<T>>

IProofCache.get


set(key, value, ttlMs?): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980

Set an entry in the cache

string | CacheKey

T

number

Promise<boolean>

IProofCache.set


delete(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984

Delete an entry from the cache

string | CacheKey

Promise<boolean>

IProofCache.delete


has(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988

Check if an entry exists

string | CacheKey

Promise<boolean>

IProofCache.has


clear(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992

Clear all entries

Promise<void>

IProofCache.clear


getStats(): ProofCacheStats

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996

Get cache statistics

ProofCacheStats

IProofCache.getStats


keys(pattern?): Promise<string[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000

Get all keys matching a pattern

string

Promise<string[]>

IProofCache.keys


addEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004

Add an event listener

CacheEventListener

void

IProofCache.addEventListener


removeEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008

Remove an event listener

CacheEventListener

void

IProofCache.removeEventListener


getSizeBytes(): number

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3017

Get the current size in bytes

number


getEntryCount(): number

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3021

Get the entry count

number


evict(count?): number

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3025

Manually trigger eviction

number

number


getEntriesLRU(): CacheEntry<T>[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3029

Get entries in LRU order

CacheEntry<T>[]


dispose(): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3033

Dispose of the cache and cleanup resources

void