Skip to content

store clearexpired!

Chris Petersen edited this page Oct 16, 2014 · 1 revision

store-clearexpired! clears entries older than timeout from the data store

Parameter Description
store The store name
timeout The timeout in seconds
ids The ids to be cleared, either a single one or a list of ids
thunk Optional: Function (cb store id) to be applied for each element removed

Example

Example 1 :

> (define store (make-store "main"))
> (store-set! store "HR" 78)        
> (set! ##now (+ ##now 10.))  ;; This is a terrible hack to advance the clock on Console
> (store-clearexpired! store 15 "HR")
> (store-ref store "HR")
78
> (set! ##now (+ ##now 10.))  ;; This is a terrible hack to advance the clock on Console
> (store-clearexpired! store 15 "HR")
> (store-ref store "HR")
#f
Clone this wiki locally