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

insufficient documentation #31

Open
daxim opened this issue Jul 4, 2017 · 0 comments
Open

insufficient documentation #31

daxim opened this issue Jul 4, 2017 · 0 comments

Comments

@daxim
Copy link

daxim commented Jul 4, 2017

I have worked with about a dozen of different caches, but with the documentation at hand, I can't figure out even the most basic task, storing and retrieving data with a simple key. Hypothetical, to give you an idea:

import Cache from 'ladda-cache';
import sleep from 'es7-sleep';
const c = new Cache;
c.set({
    key: 'KEY',
    value: 'VALUE',
    expires: Date.now() + 2000
});
console.log(c.get({key: 'KEY'})); // 'VALUE'
await sleep(2000);
console.log(c.get({key: 'KEY'})); // null

What does the real code need to look like?

Further questions, didn't find anything useful when grepping for keywords:

  • How do you replace data for a valid key in an atomic fashion?
  • What are the means in ladda to avoid stampedes?
  • How do you partition the cache with namespaces or similar so that keys don't trample over each other accidentally?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant