A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sigma/pcache below:

sigma/pcache: persistent caching for Emacs

pcache provides a persistent way of caching data, in a hashtable-like structure. It relies on `eieio-persistent' in the backend, so that any object that can be serialized by EIEIO can be stored with pcache.

pcache handles objects called "repositories" (pcache-repository) and "entries" (pcache-entry). Each repository is identified by a unique name, that defines an entry in pcache-directory. Subdirectories are allowed, by the use of a directory separator in the repository name.

Example:

(let ((repo (pcache-repository "plop")))
  (pcache-put repo 'foo 42) ; store value 42 with key 'foo
  (pcache-get repo 'foo) ; => 42
)

Keys can be pretty much any Lisp object, and are compared for equality using eql

Optionally, cache entries can expire:

(let ((repo (pcache-repository "plop")))
  (pcache-put repo 'foo 42 1) ; store value 42 with key 'foo for 1 second
  (sleep-for 1)
  (pcache-get repo 'foo) ; => nil
)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4