Sha256: b16473d44ffe0110f87734e1bee0f6d3e94cb695f316757da4205b80dbf9ec0a

Contents?: true

Size: 741 Bytes

Versions: 21

Compression:

Stored size: 741 Bytes

Contents

const { queue } = require('async');
const Fingerprinter = require('./fingerprinter');

class FingerprintQueue {
  constructor(size = 5, printCanonicalAppMaps = true) {
    this.size = size;
    // eslint-disable-next-line no-use-before-define
    this.handler = new Fingerprinter(printCanonicalAppMaps);
    this.queue = queue(this.handler.fingerprint.bind(this.handler), this.size);
    this.queue.pause();
  }

  setCounterFn(counterFn) {
    this.handler.setCounterFn(counterFn);
  }

  async process() {
    return new Promise((resolve, reject) => {
      this.queue.drain(resolve);
      this.queue.error(reject);
      this.queue.resume();
    });
  }

  push(job) {
    this.queue.push(job);
  }
}

module.exports = FingerprintQueue;

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
appmap-0.72.2 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.72.1 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.72.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.71.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.70.2 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.70.1 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.70.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.69.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.68.2 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.68.1 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.68.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.67.1 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.67.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.66.2 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.66.1 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.66.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.65.1 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.65.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.64.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js
appmap-0.63.0 ./node_modules/@appland/appmap/src/fingerprint/fingerprintQueue.js