Skip to content

Instantly share code, notes, and snippets.

@k1dbl4ck
Last active December 15, 2020 11:41
Show Gist options
  • Save k1dbl4ck/4c51ac6dffe6ed19ffaaef923a41646d to your computer and use it in GitHub Desktop.
Save k1dbl4ck/4c51ac6dffe6ed19ffaaef923a41646d to your computer and use it in GitHub Desktop.
data class CachePolicy(
val type: Type? = Type.ALWAYS,
val expires: Long = 0
) {
enum class Type {
NEVER, // never create a cache line for the key
ALWAYS, // always create a cache line for the key
REFRESH, // re-fetch (refresh) the cache line for the key
CLEAR, // clear the cache line for the key
EXPIRES // expire this cache line and refresh if older than expires
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment