Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dherberger
Copy link

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.

Daryll Herberger and others added 7 commits July 16, 2014 14:17
…r pre-caching objects from network responses that may not be immediately used
… -- calling this selector appears to remove the cache directory entirely, resulting in failure to make subsequent insertions into the properly named subfolder on disk
Removing call to delete cache directory for a SAMCache named instance --...
…e saving operation is asynchronous, adding selector to allow for disk queue writing completion callback
…ory cache while keeping the disk cache intact, added unit test coverage for the new selectors
@dherberger dherberger changed the title Disk-only cache writing Disk-only cache writing and ability to flush memory cache Nov 20, 2014
@dherberger
Copy link
Author

Hi @soffes -- Thanks for pulling in some of my previous edits/contributions! I'm a big fan of your work. :)

When you have some spare time, please review this pull request -- It adds a few additional things that have come in great handy on projects.

Cheers!

@soffes
Copy link
Owner

soffes commented Nov 20, 2014

Looks really good @dherberger! Can you review @calebd?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants