LRUStorage stores data in a Least Recently Used (LRU) cache.
- Source:
Methods
(async) clear()
Clears the contents of the LRU cache.
- Source:
(async) del(hash)
Deletes data from the LRU cache.
Parameters:
Name | Type | Description |
---|---|---|
hash |
string | The hash of the data to delete. |
- Source:
(async) get(hash)
Gets data from the LRU cache.
Parameters:
Name | Type | Description |
---|---|---|
hash |
string | The hash of the data to get. |
- Source:
(async, generator) iterator()
Iterates over records stored in the LRU cache.
- Source:
Yields:
[string, string] The next key/value pair from the LRU cache.
(async) merge(other)
Merges data from another source into the LRU cache.
Parameters:
Name | Type | Description |
---|---|---|
other |
module:Storage | Another storage instance. |
- Source:
(async) put(hash, data)
Puts data to the LRU cache.
Parameters:
Name | Type | Description |
---|---|---|
hash |
string | The hash of the data to put. |
data |
* | The data to store. |
- Source: