Browse Source

Wrapping synchronous memory cache callbacks in process.nextTick()

hotfix/0.7.1
Bryan Donovan 11 years ago
parent
commit
cb88ca1743
  1. 5
      History.md
  2. 8
      lib/stores/memory.js
  3. 2
      package.json

5
History.md

@ -1,3 +1,6 @@
- 0.1.2 2013-10-13
Wrapping synchronous memory cache callbacks in process.nextTick() for the purists.
- 0.1.1 2013-10-13
Travis and Coveralls integration testing.
@ -18,7 +21,7 @@
Added ability to pass in a store module that isn't already instantiated.
E.g.,
```javascript
var store = require('/path/my_memory_store');
var store = require('/path/to/my_memory_store');
cache = caching({store: store});
```
- 0.0.1 2013-04-08

8
lib/stores/memory.js

@ -15,18 +15,20 @@ var memory_store = function (args) {
self.set = function (key, value, cb) {
lru_cache.set(key, value);
if (cb) {
cb(null);
process.nextTick(cb);
}
};
self.get = function (key, cb) {
cb(null, lru_cache.get(key));
process.nextTick(function () {
cb(null, lru_cache.get(key));
});
};
self.del = function (key, cb) {
lru_cache.del(key);
if (cb) {
cb(null);
process.nextTick(cb);
}
};

2
package.json

@ -1,6 +1,6 @@
{
"name": "cache-manager",
"version": "0.1.1",
"version": "0.1.2",
"description": "Cache module for Node.js",
"main": "index.js",
"scripts": {

Loading…
Cancel
Save