data.table::setDTthreads(2)
newCache <- tempdir2()
createCache(newCache)
out <- Cache(rnorm(1), cachePath = newCache)
cacheId <- gsub("cacheId:", "", attr(out, "tags"))
loadFromCache(newCache, cacheId = cacheId)
rmFromCache(newCache, cacheId = cacheId)
# clean up
unlink(newCache, recursive = TRUE)
data.table::setDTthreads(2)
newCache <- tempdir2()
# Given the drv and conn, creates the minimum infrastructure for a cache
createCache(newCache)
CacheDBFile(newCache) # identifies the database file
CacheStorageDir(newCache) # identifies the directory where cached objects are stored
out <- Cache(rnorm(1), cachePath = newCache)
cacheId <- gsub("cacheId:", "", attr(out, "tags"))
CacheStoredFile(newCache, cacheId = cacheId)
# The name of the table inside the SQL database
CacheDBTableName(newCache)
CacheIsACache(newCache) # returns TRUE
# clean up
unlink(newCache, recursive = TRUE)
Run the code above in your browser using DataLab