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

store-timedrefsec returns a value from the data store if it is newer than the specified timeout.

Parameter Description
store The store name
id The key for which a value is retrieved
tout The timeout, in seconds, after which the fallback is returned }
fback Optional: The fallback value to be returned if the id is not found, e.g. '(). If not specified #f is returned.

Example

Example 1: Create a store, set a value and retrieve it with store-timedrefsec

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