Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Blob Cache to use an IBlobCacheProvider #347

Conversation

PureWeen
Copy link
Collaborator

@PureWeen PureWeen commented Mar 6, 2017

Changed Splat registrations to use an IBlobCacheProvider so how the cache is created can be reused and tapped into more easily. Static caches retain current behavior. Also added some static helpers to BlobCache

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
How Blob Caches are constructed isn't really exposed at all to a user. If I don't want to to use the static helpers I don't have a great way to reuse how Akavache news up the Blob Caches.
#342

What is the new behavior (if this is a feature change)?

How BlobCaches are created currently can't be reused very easily and overall I think this leads to some difficulty for new users with implementing the life cycle correctly in something like mobile apps. I set it up to register two different types of IBlobCacheProviders.

Does this PR introduce a breaking change?
It shouldn't. If someone was registering on top of the current Splat registrations (i.e. "UserAccount") those should still work just fine

Please check if the PR fulfills these requirements

Other information:
If how I did this is something that is appealing and gets merged I'll add some additional docs around these.

My initial thought was just to add an additional Splat registration with Func's but then I decided to go the provider route
Here is that branch in case anyone is interested
https://github.com/PureWeen/Akavache/tree/added_splat_registration_to_new_up_caches

@ghuntley
Copy link
Member

ghuntley commented May 20, 2017

Parking this one & not including in the release that's going out in a couple moments. Don't have time to properly consider the impact. Thanks @PureWeen as always.

@Im-PJ
Copy link

Im-PJ commented Jul 18, 2017

Will this be merged? I was using static BlobCache everywhere in XF and I think I'm doing wrong after reading this.

@anaisbetts
Copy link
Member

anaisbetts commented Aug 27, 2017

What if instead we just extracted this logic out into a method:

fs.CreateRecursive(fs.GetDefaultLocalMachineCacheDirectory()).

and made it so that you got the path to this? createDefaultLocationForCache(BlobCacheType.Secure) or something. That way people can easily recreate BlobCache.*, without the AbstractFactoryBeanProvider :)

@PureWeen PureWeen changed the base branch from develop to master May 28, 2018 01:54
@PureWeen PureWeen closed this Mar 4, 2019
@lock lock bot locked and limited conversation to collaborators Jun 24, 2019
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.

None yet

4 participants