Cached Response Producer
class CachedResponseProducer(responseCacheSize: Int, clock: Clock) : ResponseProducer
Content copied to clipboard
A ResponseProducer subclass that produces responses from cached data
Parameters
responseCacheSize
the maximum size of items to store in the cache
clock
an entity that produces the current unix time
Constructors
CachedResponseProducer
Link copied to clipboard
the maximum size of items to store in the cache
Functions
cacheResponse
Link copied to clipboard
fun cacheResponse(uri: String, data: Map<String, String>, cacheForMsec: Long = DEFAULT_CACHE_ENTRY_INTERVAL)
Content copied to clipboard
canHandleRequest
Link copied to clipboard
produceResponse
Link copied to clipboard
open suspend override fun produceResponse(request: Metador.Request): Result<Map<String, String>, Throwable>
Content copied to clipboard