Closed bkdotcom closed 6 years ago
In terms of behaviour, this was mostly alright - items would no longer be accessible after flush, and $limit would be respected (in that it wouldn't build up and lead to a crash) A flushed collection's stuff would be evicted eventually anyway, but as you said, it would be possible for other thing's to be evicted first (by LRU) I agree that it would be better to actually wipe them out entirely - just submitted that fix!
Couchbase & Memcached collections extend PrefixReset...
flush()
is implemented via " just start a new collection" methodology... This serves to invalidate all keys from the perspective of the collection... it doesn't actually do any trash collection.. the collection could be full of keys set with no expiry (a memory/resource leak)One use-case for performing a flush may be to free said resources immediatelyrather than rely on the server's LRU mechanism...
PSR-16 defines the clear method as
Which doesn't explicitly state that the resources are freed
Perhaps not necessarily a bug, but something that needs to be documented?