LRUCache.set()

Put a new object in the cache associated with the specified key.

Note that if the size of the LRU cache is reached the LRU cache will discard the least recently used object in the cache

Usage

Hover over inputs/exits for more info.

var LRUCache = require('machinepack-lrucache');


// Put a new object in the cache associated with the specified key.

LRUCache.set({

key: 'id',

value: 'some object',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

key required

The key used to store the obejct in the cache.

'id'
value required

The object associated with the key.

'some object'

Exits

error

An unexpected error occurred.

success

OK.