You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After using Teller a while, there is the potential to have lots of caches saved to the local device.
As an example, you have a DataSource that retrieves the user profile of a user's social media account. If you simply call saveCache() for every retrieval of every social media account, you could end up retrieving an infinite amount of cache. Teller at this does not provide a convenient way to delete cache that is obsolete. It's a manual process at this time.
Proposal: Teller tells your app what cache is (1) a certain age old or (2) the oldest of the cache collection so that you can delete your cache, easily.
Proposed API:
classUserProfileDataSource:DataSource{varobsoleteAgeOfCache:Period=Period(unit:5, component:.months)
// or...
varnumberOfCacheResultsToKeep=100func deleteOldCache(_ requirements:Requirements){
// Will be called for cache results that are > 5 months old or...
// will be called for cache that is the 101 oldest cache result or older.
}}
You can specify neither, both, or one of the obsoleteAgeOfCache or numberOfCacheResultsToKeep properties. Teller will call deleteOldCache() with requirements that meets at least 1 of the criteria. deleteOldCache() does not allow throwing so it's recommended that a delete call error is recorded manually by the developer. Also, if the optional function deleteOldCache() is not defined in the DataSource, Teller will skip the delete request and will be called again the next time the DataSource is initialized.
The text was updated successfully, but these errors were encountered:
I wrote some migration code in my app where I needed to delete the old Teller cache data of 1 of my repositories so when the app installs the new update, just that 1 cache gets re-created.
I propose adding a clear() function to the Repository class that will (1) call deleteOldCache() on the data source to delete all of the old cache and (2) delete the Teller metadata associated with that repo.
After using Teller a while, there is the potential to have lots of caches saved to the local device.
As an example, you have a
DataSource
that retrieves the user profile of a user's social media account. If you simply callsaveCache()
for every retrieval of every social media account, you could end up retrieving an infinite amount of cache. Teller at this does not provide a convenient way to delete cache that is obsolete. It's a manual process at this time.Proposal: Teller tells your app what cache is (1) a certain age old or (2) the oldest of the cache collection so that you can delete your cache, easily.
Proposed API:
You can specify neither, both, or one of the
obsoleteAgeOfCache
ornumberOfCacheResultsToKeep
properties. Teller will calldeleteOldCache()
with requirements that meets at least 1 of the criteria.deleteOldCache()
does not allow throwing so it's recommended that a delete call error is recorded manually by the developer. Also, if the optional functiondeleteOldCache()
is not defined in the DataSource, Teller will skip the delete request and will be called again the next time theDataSource
is initialized.The text was updated successfully, but these errors were encountered: