Comments (6)
@alidevhere Thanks your initial PoC but I'm sorry I cannot accept the PR 🙏
Yes, I made this PR just to show POC i will make a complete PR later
from go-generics-cache.
@alidevhere Thanks
What do you think for the usage?
from go-generics-cache.
@Code-Hex I need to add graceful shutdown for my server. If my server restarts it should save whatever in cache and reload when started again.
So if a make little fix and restart it doesnot affect other processes going on.
from go-generics-cache.
@alidevhere I see. sounds good.
I think that the development direction should be as follows:
- Create new options like
WithSave
,WithRestore
. WithSave
may have a functional parameter likefunc(cache Interface) {}
and this function will be called received context.Done.WithRestore
may have a functional parameter likefunc(cache Interface) {}
and this function will be initialized.
Is it possible to contribute in this way?
from go-generics-cache.
@Code-Hex Yeah sure!!
I have created a proof of concept pull request, I tried to Add Save and Load functions for cache. Let me share my findings with you:
- I used gob and gob needs Struct fields to be exported/public to encode and decode them.
- It is 100% working with simple cache. But for other algorithm caches we use datastructures like linked list etc. In these cases it is not as straight forward as for simple cache. We will have to do some manual work.
@Code-Hex I will do some more work on it with directions you gave.
Thanks
from go-generics-cache.
@alidevhere Thanks your initial PoC but I'm sorry I cannot accept the PR 🙏
from go-generics-cache.
Related Issues (10)
- Maybe change containers/list to implementations on generics HOT 5
- Improved performance/memory usage for items with an expiry HOT 8
- Clock policy: Not show all the page with sequential access pattern HOT 1
- Can a read-write lock be used in the cache instead of a mutex? HOT 1
- fatal error: concurrent map read and map write HOT 1
- Panic when deleting expired items HOT 3
- LFU: Allow setting the frequency and update the heap HOT 2
- Panic when delete expired items. HOT 1
- Len() method missing from common cache interface HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-generics-cache.