Learn R Programming

rredis (version 1.7.0)

redisExpire: Set a timeout on the specified key.

Description

Set a timeout on the specified key, after which the key and corresponding value will be deleted.

Usage

redisExpire(key, seconds) redisPexpire(key, milliseconds)

Arguments

key
The character key on which to set the timeout.
seconds
The integer timeout in seconds.
milliseconds
The integer timeout in milliseconds.

Value

Boolean TRUE if the timeout command was successful, FALSE otherwise.

Details

Operations that modify value(s) corresponding to a key subsequent to the redisExpire function clear the timeout, removing the expiration. The redisExpire function can't set a new timeout value once a timeout has been set on a key.

References

http://redis.io/commands

See Also

redisExpireAt

Examples

Run this code
## Not run: 
# redisConnect()
# redisLPush('x',runif(5))
# redisExpire('x', 3)
# ## End(Not run)

Run the code above in your browser using DataLab