-
Notifications
You must be signed in to change notification settings - Fork 4
/
cache.ss
30 lines (24 loc) · 944 Bytes
/
cache.ss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#lang scheme/base
(require "base.ss"
"cache-internal.ss")
; (key -> value)
; (key value -> void)
; [#:expire (key value -> void)]
; [#:lifetime natural]
; ->
; cache
(define (create-cache load store #:expire [expire void] #:lifetime [lifetime 3600])
(make-cache load store expire lifetime))
; (key -> value)
; (key value -> void)
; [#:expire (key value -> void)]
; [#:lifetime natural]
; ->
; cacheeq
(define (create-cacheeq load store #:expire [expire void] #:lifetime [lifetime 3600])
(make-cacheeq load store expire lifetime))
; Provide statements -----------------------------
(provide (except-out (all-from-out "cache-internal.ss") make-cache make-cacheeq))
(provide/contract
[rename create-cache make-cache (->* (procedure? procedure?) (#:expire procedure? #:lifetime (>/c 0)) cache?)]
[rename create-cacheeq make-cacheeq (->* (procedure? procedure?) (#:expire procedure? #:lifetime (>/c 0)) cache?)])