put

abstract fun <T> put(id: QueryId<T>, data: T, dataUpdatedAt: Long = epoch(), dataStaleAt: Long = dataUpdatedAt, ttl: Duration = Duration.INFINITE)

Puts the query data into the cache.

Parameters

id

Unique identifier for the query.

data

Data to store.

dataUpdatedAt

Timestamp when the data was updated. Default is the current epoch time.

dataStaleAt

The timestamp after which data is considered stale. Default is the same as dataUpdatedAt

ttl

Time to live for the data. Default is Duration.INFINITE


abstract fun <T, S> put(id: InfiniteQueryId<T, S>, data: QueryChunks<T, S>, dataUpdatedAt: Long = epoch(), dataStaleAt: Long = dataUpdatedAt, ttl: Duration = Duration.INFINITE)

Puts the infinite-query data into the cache.

Parameters

id

Unique identifier for the infinite query.

data

Data to store.

dataUpdatedAt

Timestamp when the data was updated. Default is the current epoch time.

dataStaleAt

The timestamp after which data is considered stale. Default is the same as dataUpdatedAt

ttl

Time to live for the data. Default is Duration.INFINITE