Sha256: ff2b3c4f0f9dfdb6392e3a96001f812cc118e916a79a321ff825f5ee82361b2f

Contents?: true

Size: 578 Bytes

Versions: 48

Compression:

Stored size: 578 Bytes

Contents

"use strict";

/**
 * Manage all the request and it is able to abort
 * all pending request.
 */
module.exports = class RequestManager {
  constructor() {
    this.openedRequests = [];
  }

  add(req) {
    this.openedRequests.push(req);
  }

  remove(req) {
    const idx = this.openedRequests.indexOf(req);
    if (idx !== -1) {
      this.openedRequests.splice(idx, 1);
    }
  }

  close() {
    for (const openedRequest of this.openedRequests) {
      openedRequest.abort();
    }
    this.openedRequests = [];
  }

  size() {
    return this.openedRequests.length;
  }
};

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
clapton-0.0.6 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
clapton-0.0.1 lib/clapton/javascripts/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.72.2 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.72.1 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.72.0 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.71.0 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.70.2 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.70.1 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.70.0 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.69.0 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.68.2 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.68.1 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.68.0 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.67.1 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.67.0 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js
appmap-0.66.2 ./node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js