reference-count
v0.1.2
Published
count references to resources and clean up after sweeps
Downloads
1,068
Readme
reference-count
count references to resources and clean up after sweeps
Usage
var Context = require('reference-count');
var context = new Context();
context.on('resource', function(resource) {
// called anytime there is a new resource counted
});
context.on('garbage', function(resource) {
// clean up the resource here
});
context.sweep('actor1')
.count('resource1')
.count(['resource2', 'resource3'])
.done();
context.sweep('actor1')
.count('resource1')
.count('resource2'])
.done();
context.destory('actor1');