1234567891011121314151617181920212223242526272829 |
- 'use strict';
-
- var utils = require('../utils');
- var GenericWorker = require('./GenericWorker');
-
-
- function DataLengthProbe(propName) {
- GenericWorker.call(this, "DataLengthProbe for " + propName);
- this.propName = propName;
- this.withStreamInfo(propName, 0);
- }
- utils.inherits(DataLengthProbe, GenericWorker);
-
-
- DataLengthProbe.prototype.processChunk = function (chunk) {
- if(chunk) {
- var length = this.streamInfo[this.propName] || 0;
- this.streamInfo[this.propName] = length + chunk.data.length;
- }
- GenericWorker.prototype.processChunk.call(this, chunk);
- };
- module.exports = DataLengthProbe;
|