-
Notifications
You must be signed in to change notification settings - Fork 159
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
Support for IDistributedCache #59
Comments
I was thinking on extending te current ICacheProvider interface to something like this.
|
Yeah something like that would be the way to go. The challenge is that you need to come up with a way to handle the binary serialisation required by IDistributedCache (I suggest BSON as a default, but using another provider model for the serialiser to allow anyone to swap out the binary serialiser if needed) and you need to solve the fact that MemoryCacheEntryOptions dont make sense for IDistributedCache, instead you need DistributedCacheEntryOptions |
Yes, I agree. I thik that part sholdnt be a big deal. What is stopping me currently is the fact what is being stored is the Lazy "Func<ICacheEntry, T> factory" I'm kinda confused here is what im doing! So when i run this code my result is the func not the result from the factory method!
|
I guess I went to fast thru this part that indeed is the most critical lol.
I have implement a total new IDistributedAppCache very similar but when it
comes to deserializing the Lazy Task it breaks need to dig more into this.
…On Wed, Mar 20, 2019 at 8:36 PM Alastair Crabtree ***@***.***> wrote:
Yeah something like that would be the way to go. The challenge is that you
need to come up with a way to handle the binary serialisation required by
IDistributedCache (I suggest BSON as a default, but using another provider
model for the serialiser to allow anyone to swap out the binary serialiser
if needed) and you need to solve the fact that MemoryCacheEntryOptions dont
make sense for IDistributedCache, instead you need
DistributedCacheEntryOptions
<https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.distributed.distributedcacheentryoptions?view=aspnetcore-2.2>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJma_CsfyvuYLcHn3RlTNmWSdMdl_D8_ks5vYtQTgaJpZM4b_1xw>
.
|
I don't think there is any point in putting the lazy into the distributed cache, because it will be a serialised version not the original one with references to real databases and connections and stuff in the factory. Better to wait till the lazy is evaluated and cache the result in the distributed cache I think. |
Yes, I was originally inclined to do that. Probably my fatigue yesterday blind my mind! |
I think i got it! I'll do a pull request so you can take a look! |
How can I share this code with you i tried to push a new branch but not success could you create a new branch with open access? |
You need to fork the repo and push to your fork, then you can open a PR from your fork branch into here |
Thanks |
Do you mind taking a look into it https://github.com/alexdobarganes/LazyCache/tree/distributed-cache |
I created a PR for your work @alexdobarganes at #63 |
any news on this? the last comments where done more than an year ago |
Any news on this? |
No, have not had a need for it so have not put any time into it, and the PR seems to have stalled. |
[To support this feature request please add a thumbs up]
It would be good to extend this current project to support IDistributedCache!
The text was updated successfully, but these errors were encountered: