/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import n from"./RasterJobHandler.js";const t={instance:null,refCount:0,connectionPromise:null};async function e(){if(t.refCount++,t.instance)return t.instance;if(!t.connectionPromise){const e=new n;t.connectionPromise=e.initialize().then(()=>{t.instance=e})}return await t.connectionPromise,t.instance}function o(){t.refCount--,t.refCount>0||c()}function i(){return t.refCount}function c(){t.instance?.destroy(),t.instance=null,t.connectionPromise=null,t.refCount=0}export{e as getRasterJobHandler,i as getRefCount,o as releaseRasterJobHandler};
