Scoop API

scoop:scoop.http.client:0.1.0

DiskHttpCache

class DiskHttpCache

source · line 13
public
public class DiskHttpCache private constructor(
    /**
     * The cache entry directory.
     */
    public val directory: Path,
    /**
     * Maximum total accounted storage bytes.
     */
    public val maxBytes: Long,
    /**
     * Maximum body bytes accepted for one entry.
     */
    public val maxEntryBytes: Long,
    /**
     * Maximum committed entry count.
     */
    public val maxEntries: Long,
    /**
     * Maximum metadata bytes accepted for an entry.
     */
    public val maxMetadataBytes: Long,
    /**
     * Whether completed entry data is synchronized before publication.
     */
    public val syncOnCommit: Boolean
) : HttpCache

A bounded disk cache with atomic entry publication and owned read snapshots. Open it on the active event loop; pending writes do not appear as completed entries.

property maxEntryBytes

source · line 25
public
public val maxEntryBytes: Long

get: public read-only

Maximum body bytes accepted for one entry.

property directory

source · line 17
public
public val directory: Path

get: public read-only

The cache entry directory.

property maxBytes

source · line 21
public
public val maxBytes: Long

get: public read-only

Maximum total accounted storage bytes.

property syncOnCommit

source · line 37
public
public val syncOnCommit: Boolean

get: public read-only

Whether completed entry data is synchronized before publication.

property maxMetadataBytes

source · line 33
public
public val maxMetadataBytes: Long

get: public read-only

Maximum metadata bytes accepted for an entry.

property maxEntries

source · line 29
public
public val maxEntries: Long

get: public read-only

Maximum committed entry count.

function clear

source · line 149
public
public suspend fun clear(): Unit

Invalidates all entries and prevents existing tentative writes from publishing.