UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 586 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{QueueProcessor as s}from"../../../../core/QueueProcessor.js";class e{constructor(e){this._outstandingMessages=[],this._queue=new s({concurrency:e.concurrency,process:s=>e.process(s)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}}export{e as ProcessorTileMessageQueue};