5.0.1 • Published 9 years ago

distribucache-memory-store v5.0.1

Weekly downloads
19
License
-
Repository
github
Last release
9 years ago

Distribucache Memory Store Build Status NPM version

A memory (RAM) datastore for the Distribucache auto-repopulating cache.

Usage

Here's what a simple service using Distribucache with memory may look like:

var distribucache = require('distribucache'),
  memoryStore = require('distribucache-memory-store'),

  cacheClient = distribucache.createClient(memoryStore()),

  model = require('../model'), // for example
  cache,
  Service;

cache = cacheClient.create('my:values', {
  staleIn: '10 sec',
  populateIn: '5 sec',
  pausePopulateIn: '1 min',
  populate: function (key, cb) {
    model.get(key, cb);
  }
});

Service.get = function (key, cb) {
  cache.get(key, cb);
};

API

  • memoryStore()

License

MIT

5.0.1

9 years ago

5.0.0

9 years ago

4.0.0

9 years ago

3.1.0

9 years ago

3.0.0

9 years ago

1.0.0

9 years ago