Skip to content

Commit

Permalink
Renaming ExpireAfterWriteCache to ExpirationCache
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Jun 14, 2017
1 parent 38c5129 commit c77761c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cache/expire-after-write.js → cache/expiration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const TimerWheel = require('../utils/timer-wheel');
*
* Currently supports expiration based on maximum age.
*/
module.exports = ParentCache => class ExpireAfterWriteCache extends ParentCache {
module.exports = ParentCache => class ExpirationCache extends ParentCache {
constructor(options) {
super(options);

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const BoundedCache = require('./cache/bounded');
const BoundlessCache = require('./cache/boundless');

const LoadingCache = require('./cache/loading');
const ExpireAfterWriteCache = require('./cache/expire-after-write');
const ExpirationCache = require('./cache/expiration');
const MetricsCache = require('./cache/metrics');

const memoryEstimator = require('./utils/memoryEstimator');
Expand Down Expand Up @@ -104,7 +104,7 @@ class Builder {
}

if(this.options.maxWriteAge > 0) {
Impl = ExpireAfterWriteCache(Impl);
Impl = ExpirationCache(Impl);
}

if(this.options.metrics) {
Expand Down
6 changes: 3 additions & 3 deletions test/expire-after-write.test.js → test/expiration.test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

const { expect } = require('chai');
const BoundlessCache = require('../cache/boundless');
const ExpireAfterWriteCache = require('../cache/expire-after-write');
const ExpirationCache = require('../cache/expiration');
const RemovalCause = require('../utils/removal-cause');

const newCache = (listener) => {
let Impl = ExpireAfterWriteCache(BoundlessCache);
let Impl = ExpirationCache(BoundlessCache);
return new Impl({
maxWriteAge: () => 10,
removalListener: listener
});
};

describe('ExpireAfterWriteCache', function() {
describe('ExpirationCache', function() {
it('Can create', function() {
expect(newCache()).to.not.be.null;
});
Expand Down

0 comments on commit c77761c

Please sign in to comment.