Open atusy opened 2 months ago
maybe preprocess and postprocess are not good names... :thinking:
I got to fix tests
To solve the above problems, I implemented the knit_cache_hook
generic function in place of knit_cache_preprocess
and knit_cache_postprocess
. See updated description for the details.
This PR allows implementing
knit_cache_hook
methods which may preprocess objects (e.g., save to an external file) and define custom loaders.I will add a NEWS item after we agree with the design.
cache_save
replaces rdb/rdx files with rds filecache_load()
attemptslazyload()
if rdb/rdx files are availablefeat(cache): allow pre/postprocessing cache objects)knit_cache_preprocess
preprocesses objects being savedknit_cache_postprocess
postprocesses objects being loadedknit_cache_hook
methods on saving cache${cache_path(h)}__extra
directory${cache_path(h).rds}
With this PR, we can add some hooks on objects to be cached. For example, we can use writeLines to save character objects.