;;; pcache.el --- persistent caching for Emacs. -*- lexical-binding: t; -*-
;; Copyright (C) 2011-2020 Yann Hodique
;; Author: Yann Hodique <yann.hodique@gmail.com>
;; Keywords: extensions
;; Package-Version: 20220724.1841
;; Package-Commit: cae29ddbc3d12fac18ab5cfc26fa3ef13eb97dad
;; Version: 0.5.1
;; Package-Requires: ((emacs "25.1"))
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;; 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
;; )
;;; Code:
;; force custom implementation.
;; force custom implementation.
;; in case we reload in place, clean all repositories with invalid version
;;; pcache.el ends here