Skip to content

aikidos/memory_cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

MemoryCache

Simple local in-memory cache for Nim.

Example

import memory_cache
import times
import options

var cache: MemoryCache[string, string]

let value = cache.getOrCreate("key", proc (options: var CacheOptions): string = "Hello, world!")

echo value                  # Hello, world!
echo cache.get("key")       # Some("Hello, world!")
echo cache.get("wrong_key") # None[string]

About

Simple local in-memory cache for Nim.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages