MemoryResumableCache

class MemoryResumableCache(map: MutableMap<String, String> = AtomicMutableMap()) : ResumableCache(source)

A ResumableCache implementation using AtomicMutableMap. This implementation saves the urls in memory. If you want a disk based cache, use Disk. By default, cached urls expire after 30 minutes. You can change this by passing a custom AtomicMutableMap to the constructor

Constructors

Link copied to clipboard
constructor(map: MutableMap<String, String> = AtomicMutableMap())

Functions

Link copied to clipboard
open suspend override fun clear()

Clears the cache

Link copied to clipboard
open suspend override fun entries(): List<CachePair>

Returns all entries in the cache

Link copied to clipboard
open suspend override fun get(fingerprint: Fingerprint): ResumableCacheEntry?

Returns the resumable cache entry for the fingerprint or null if no url was stored

Link copied to clipboard
open suspend override fun remove(fingerprint: Fingerprint)

Removes the entry for the fingerprint

Link copied to clipboard
open suspend override fun set(fingerprint: Fingerprint, entry: ResumableCacheEntry)

Stores the entry for the fingerprint. The fingerprint consists of the bucket id, the file path and the file size