process(callback) {
      let webComponent;
      const stats = new Map();
      webComponent = this.shift();
      while (webComponent) {
        const timesProcessed = stats.get(webComponent) || 0;
        if (timesProcessed > MAX_PROCESS_COUNT) {
          throw new Error(`Web component processed too many times this task, max allowed is: ${MAX_PROCESS_COUNT}`);
        }
        callback(webComponent);
        stats.set(webComponent, timesProcessed + 1);
        webComponent = this.shift();
      }
    }
Processes the whole queue by executing the callback on each component,
while also imposing restrictions on how many times a component may be processed.

@param callback - function with one argument (the web component to be processed)