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