This repository has been archived by the owner on Aug 24, 2019. It is now read-only.
Disk-only cache writing and ability to flush memory cache #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding selectors to allow disk-only cache insertion; this is handy for pre-caching objects that may not be immediately used (for example, objects constructed from network responses).
This includes edits to update the comments on the 'setObject:' selectors for indicating the asynchronous nature of writing to the disk (as opposed to the synchronous insertion into the memory cache), along with an overloaded selector for specifying a callback block to listen for the completion of disk writing operations.
Also including an edit to expose a 'flushMemoryCache' selector that allows consumers of this cache to clear out the memory cache at will -- this does not remove the disk-cached items. This is useful for closing out memory usage in situations where it is unlikely that an end user will revisit the cached information in a short period of time, but still requires the ability to recall disk-cached information at a later point in time without re-populating the cache entirely.
Also includes test coverage.