An expired entry is already absent to every read; stash_expire() removes it
and frees its space. It walks entries from the earliest deadline, in
transactions of at most cull_limit entries (see stash()), so it never
holds the write lock for long. It can be run at any time, by any process:
it cannot change what a read returns.
Arguments
- stash
A stash, from
stash().- ...
Must be empty.
- n
The most entries to remove.
Examples
s <- local_stash()
stash_set(s, "brief", 1, expire = 0)
#> Error in stash_set(s, "brief", 1, expire = 0): This stash has been closed.
stash_count(s)
#> Error in stash_count(s): This stash has been closed.
stash_expire(s)
#> Error in stash_expire(s): This stash has been closed.
stash_count(s)
#> Error in stash_count(s): This stash has been closed.