Skip to content

Commit

Permalink
docs(readme) elaborate on new 'peek()' remaining ttl return value
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Jan 31, 2024
1 parent 92bb53d commit af14c85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,12 @@ If there is no value for the queried `key`, it returns `nil` and no error.
If there is a value for the queried `key`, it returns a number indicating the
remaining TTL of the cached value (in seconds) and no error. If the value for
`key` has expired but is still in the L2 cache, returned TTL value will be
negative. Finally, the third returned value in that case will be the cached
value itself, for convenience.
negative. The remaining TTL return value will only be `0` if the queried `key`
has an indefinite ttl (`ttl=0`). Otherwise, this return value may be positive
(`key` still valid), or negative (`key` is stale).

The third returned value will be the cached value as stored in the L2 cache, if
still available.

This method is useful when you want to determine if a value is cached. A value
stored in the L2 cache is considered cached regardless of whether or not it is
Expand Down

0 comments on commit af14c85

Please sign in to comment.