Skip to content

bennn/with-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

with-cache

Build Status Coverage Status Scribble

Simple, filesystem-based caching.

  1. Pick a directory to store caches in. By default, it's the ./compiled/with-cache directory.
  2. Wrap "expensive" computations in a thunk, call the thunk via with-cache.
  3. Results of the expensive computation are automatically stored and retrieved.

Example:

(with-cache "fact42.rktd"
  (λ () (factorial 42)))
(with-cache "pict.rktd"
  (λ () (standard-fish 100 50))
  #:read deserialize
  #:write serialize)

Install

From the Racket package server:

$ raco pkg install with-cache

From Github:

$ git clone https://github.com/bennn/with-cache
$ raco pkg install ./with-cache

Don't forget the ./!

More

The real documentation is here: http://docs.racket-lang.org/with-cache/index.html

and has instructions for:

  • invalidating cachefiles
  • changing the default cache directory
  • cachefile naming conventions

About

Simple, filesystem-based caching for Racket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages