Yea, I was going to ask what the best way to handle expiration was but nobody was around at midnight. The reaper sounds simpler.

On Tue, Jul 30, 2013 at 9:05 AM, Daniel Pupius <notifications@github.com>
wrote:

>> +  return true
>> +}
>> +
>> +InMemoryCache.prototype.mget = function (keys) {
>> +  var ret = []
>> +  for (var i = 0, key; key = keys[i]; i++) {
>> +    ret.push(this._data[key])
>> +  }
>> +  return Q.resolve(ret)
>> +}
>> +
>> +InMemoryCache.prototype.mset = function (items, maxAgeMs) {
>> +  for (var i = 0, item; item = items[i]; i++) {
>> +    this._data[item.key] = item.value
>> +    ;(function (data, key) {
>> +      setTimeout(function () {
> You also don't want a timeout for every mset and set.  Have a single scheduled reaper to clean out old items.  Also, check on get to see if the item has expired.
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/Obvious/zcache/pull/9/files#r5480510