ILRUCache<T>
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / ILRUCache
Interface: ILRUCache<T>
Section titled “Interface: ILRUCache<T>”Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3013
LRU cache interface
Extends
Section titled “Extends”IProofCache<T>
Type Parameters
Section titled “Type Parameters”T = SingleProof
Methods
Section titled “Methods”get(
key):Promise<CacheLookupResult<T>>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976
Get an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<CacheLookupResult<T>>
Inherited from
Section titled “Inherited from”set(
key,value,ttlMs?):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980
Set an entry in the cache
Parameters
Section titled “Parameters”string | CacheKey
T
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984
Delete an entry from the cache
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”has(
key):Promise<boolean>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988
Check if an entry exists
Parameters
Section titled “Parameters”string | CacheKey
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”clear()
Section titled “clear()”clear():
Promise<void>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992
Clear all entries
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”getStats()
Section titled “getStats()”getStats():
ProofCacheStats
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996
Get cache statistics
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”keys()
Section titled “keys()”keys(
pattern?):Promise<string[]>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000
Get all keys matching a pattern
Parameters
Section titled “Parameters”pattern?
Section titled “pattern?”string
Returns
Section titled “Returns”Promise<string[]>
Inherited from
Section titled “Inherited from”addEventListener()
Section titled “addEventListener()”addEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004
Add an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”removeEventListener()
Section titled “removeEventListener()”removeEventListener(
listener):void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008
Remove an event listener
Parameters
Section titled “Parameters”listener
Section titled “listener”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”IProofCache.removeEventListener
getSizeBytes()
Section titled “getSizeBytes()”getSizeBytes():
number
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3017
Get the current size in bytes
Returns
Section titled “Returns”number
getEntryCount()
Section titled “getEntryCount()”getEntryCount():
number
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3021
Get the entry count
Returns
Section titled “Returns”number
evict()
Section titled “evict()”evict(
count?):number
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3025
Manually trigger eviction
Parameters
Section titled “Parameters”count?
Section titled “count?”number
Returns
Section titled “Returns”number
getEntriesLRU()
Section titled “getEntriesLRU()”getEntriesLRU():
CacheEntry<T>[]
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3029
Get entries in LRU order
Returns
Section titled “Returns”CacheEntry<T>[]
dispose()
Section titled “dispose()”dispose():
void
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3033
Dispose of the cache and cleanup resources
Returns
Section titled “Returns”void