@univer-cli/generic-keyed-instance-pool 1.6.2 → 1.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5a47fa,_0x49cd38){const _0xcecafe=_0x3e30,_0x5b985e=_0x5a47fa();while(!![]){try{const _0x488563=parseInt(_0xcecafe(0x211))/0x1+-parseInt(_0xcecafe(0x1f0))/0x2*(parseInt(_0xcecafe(0x208))/0x3)+-parseInt(_0xcecafe(0x20f))/0x4*(parseInt(_0xcecafe(0x212))/0x5)+parseInt(_0xcecafe(0x1f8))/0x6+-parseInt(_0xcecafe(0x1f4))/0x7+parseInt(_0xcecafe(0x1e5))/0x8+-parseInt(_0xcecafe(0x1ee))/0x9*(-parseInt(_0xcecafe(0x1e0))/0xa);if(_0x488563===_0x49cd38)break;else _0x5b985e['push'](_0x5b985e['shift']());}catch(_0x58838d){_0x5b985e['push'](_0x5b985e['shift']());}}}(_0x338f,0x3a8f9));var e=class extends Error{['code'];constructor(_0x3889e4,_0x106331,_0x5d6b6b){const _0x17614c=_0x3e30;super(_0x106331,_0x5d6b6b),this[_0x17614c(0x1ed)]=_0x17614c(0x20b),this['code']=_0x3889e4;}},t=0x493e0,n=0x14;function r(_0xffc618){const _0x26391d=_0x3e30;let _0x162c31=new Map(),_0x2e5740=new Set(),_0x5ad7b6=new Map(),_0x1fc7cc=_0xffc618[_0x26391d(0x21a)]?.[_0x26391d(0x20c)]??t,_0x46e1d7=_0xffc618[_0x26391d(0x21a)]?.[_0x26391d(0x1de)]??n,_0xb7166=!0x1,_0x3b49d1,_0x198029=0x0;i(_0x1fc7cc,_0x46e1d7);let _0x2f3167={async 'acquire'(_0x4773fe){const _0x43c9a8=_0x26391d;_0x165e6b(),a(_0x4773fe);let _0x1ca7b1=_0x162c31[_0x43c9a8(0x214)](_0x4773fe[_0x43c9a8(0x206)]);if(_0x1ca7b1)return _0x1ca7b1[_0x43c9a8(0x200)]?await o(_0x4773fe,_0x1ca7b1[_0x43c9a8(0x1fd)]):(c(_0x1ca7b1),_0x1ca7b1[_0x43c9a8(0x200)]=!0x0,_0x19907b({'key':_0x4773fe['key'],'type':_0x43c9a8(0x1fb)}),_0x2b06a2(_0x4773fe[_0x43c9a8(0x206)],_0x1ca7b1));let _0x5c22c7=_0x5ad7b6['get'](_0x4773fe[_0x43c9a8(0x206)]);if(_0x5c22c7)return await o(_0x4773fe,_0x5c22c7);let _0x2e135a,_0x2de8b6=new Promise(_0x59afff=>{_0x2e135a=_0x59afff;});_0x2e5740[_0x43c9a8(0x1e8)](_0x2de8b6),_0x5ad7b6[_0x43c9a8(0x1df)](_0x4773fe[_0x43c9a8(0x206)],[]);let _0x5605b6=Date[_0x43c9a8(0x1f1)]();_0x19907b({'key':_0x4773fe[_0x43c9a8(0x206)],'type':_0x43c9a8(0x1fe)});try{await _0x3522ce();let _0x287219=await _0xffc618[_0x43c9a8(0x1f7)][_0x43c9a8(0x218)](_0x4773fe);if(_0xb7166)throw await _0xffc618[_0x43c9a8(0x1f7)][_0x43c9a8(0x1e9)]({'instance':_0x287219,'key':_0x4773fe['key']}),l();let _0x5eb93e={'busy':!0x0,'closed':!0x1,'instance':_0x287219,'invalidated':!0x1,'lastIdleSequence':0x0,'waiters':_0x5ad7b6[_0x43c9a8(0x214)](_0x4773fe['key'])??[]};return _0x162c31[_0x43c9a8(0x1df)](_0x4773fe[_0x43c9a8(0x206)],_0x5eb93e),_0x19907b({'durationMs':Date['now']()-_0x5605b6,'key':_0x4773fe['key'],'type':_0x43c9a8(0x20d)}),_0x2b06a2(_0x4773fe[_0x43c9a8(0x206)],_0x5eb93e);}catch(_0x82735d){throw s(_0x5ad7b6[_0x43c9a8(0x214)](_0x4773fe[_0x43c9a8(0x206)])??[],_0x82735d),_0x82735d;}finally{_0x5ad7b6['delete'](_0x4773fe[_0x43c9a8(0x206)]),_0x2e5740[_0x43c9a8(0x202)](_0x2de8b6),_0x2e135a();}},async 'close'(){if(_0x3b49d1)return await _0x3b49d1;_0xb7166=!0x0,_0x3b49d1=_0x56d142(),await _0x3b49d1;}};return _0x2f3167;function _0x2b06a2(_0x8c47fd,_0x4d9544){const _0x19a046=_0x26391d;let _0x3d486d=!0x1;return{'instance':_0x4d9544[_0x19a046(0x20a)],'key':_0x8c47fd,async 'invalidate'(){const _0x12edfd=_0x19a046;_0x3d486d||(_0x3d486d=!0x0,_0x4d9544[_0x12edfd(0x1dc)]=!0x0,await _0x28c9bf(_0x8c47fd,_0x4d9544,_0x12edfd(0x1e1)));},async 'release'(){const _0x28e63f=_0x19a046;if(_0x3d486d||(_0x3d486d=!0x0,_0x4d9544[_0x28e63f(0x204)]))return;if(_0x4d9544['invalidated']){await _0x28c9bf(_0x8c47fd,_0x4d9544,_0x28e63f(0x1e1));return;}let _0x21a085=_0x4d9544['waiters'][_0x28e63f(0x1e7)]();_0x21a085?_0x21a085[_0x28e63f(0x201)](_0x2b06a2(_0x8c47fd,_0x4d9544)):(_0x4d9544['busy']=!0x1,_0x4d9544[_0x28e63f(0x1e6)]=++_0x198029,_0x5c0dc6(_0x8c47fd,_0x4d9544));}};}async function _0x28c9bf(_0x487e29,_0x17ed60,_0x26d71c){const _0x569acd=_0x26391d;let _0xb95a8e=_0x17ed60['waiters'][_0x569acd(0x217)](0x0);_0x162c31['get'](_0x487e29)===_0x17ed60&&_0x162c31[_0x569acd(0x202)](_0x487e29);try{await _0x116b77(_0x487e29,_0x17ed60,_0x26d71c);}finally{_0x26d71c&&_0x19907b({'key':_0x487e29,'reason':_0x26d71c,'type':_0x569acd(0x215)}),_0xb7166?s(_0xb95a8e,l()):_0x48f695(_0xb95a8e);}}function _0x5c0dc6(_0x10298b,_0x369b93){const _0x180eae=_0x26391d;c(_0x369b93),_0x369b93[_0x180eae(0x1ea)]=setTimeout(()=>{const _0x2511b8=_0x180eae;_0x369b93[_0x2511b8(0x200)]||_0x162c31[_0x2511b8(0x214)](_0x10298b)!==_0x369b93||(_0x162c31['delete'](_0x10298b),_0x116b77(_0x10298b,_0x369b93,_0x2511b8(0x1ec))['then'](()=>_0x19907b({'key':_0x10298b,'reason':_0x2511b8(0x1ec),'type':_0x2511b8(0x215)}))[_0x2511b8(0x1e4)](()=>void 0x0));},_0x1fc7cc),_0x369b93[_0x180eae(0x1ea)][_0x180eae(0x20e)]?.();}async function _0x3522ce(){const _0x315365=_0x26391d;for(;_0x162c31[_0x315365(0x1f2)]+_0x5ad7b6['size']>_0x46e1d7;){let _0x38400c;for(let _0x1de9cf of _0x162c31)_0x1de9cf[0x1]['busy']||(!_0x38400c||_0x1de9cf[0x1][_0x315365(0x1e6)]<_0x38400c[0x1][_0x315365(0x1e6)])&&(_0x38400c=_0x1de9cf);if(!_0x38400c)throw new e(_0x315365(0x1f5),_0x315365(0x205)+_0x46e1d7+_0x315365(0x1eb));_0x162c31[_0x315365(0x202)](_0x38400c[0x0]),await _0x116b77(_0x38400c[0x0],_0x38400c[0x1],_0x315365(0x1e2)),_0x19907b({'key':_0x38400c[0x0],'reason':_0x315365(0x1e2),'type':_0x315365(0x215)});}}async function _0x56d142(){const _0x2f0b69=_0x26391d;let _0x441a53=l(),_0x2f6c84=[..._0x162c31[_0x2f0b69(0x210)]()];for(let [,_0xa0d61f]of _0x2f6c84)s(_0xa0d61f['waiters'],_0x441a53);for(let _0x29d6b9 of _0x5ad7b6['values']())s(_0x29d6b9,_0x441a53);_0x162c31[_0x2f0b69(0x1e3)]();let _0x4cc863=(await Promise['allSettled']([..._0x2f6c84['map'](async([_0x1bf311,_0x2b1484])=>await _0x116b77(_0x1bf311,_0x2b1484)),..._0x2e5740]))[_0x2f0b69(0x207)](_0x44559c=>_0x44559c[_0x2f0b69(0x1ef)]===_0x2f0b69(0x1fc));if(_0x4cc863?.[_0x2f0b69(0x1ef)]===_0x2f0b69(0x1fc))throw _0x4cc863[_0x2f0b69(0x209)];}function _0x19907b(_0x4e3b10){try{_0xffc618['onEvent']?.(_0x4e3b10);}catch{}}function _0x165e6b(){if(_0xb7166)throw l();}function _0x48f695(_0xf7fd52){const _0x379aad=_0x26391d;for(let _0x2b6071 of _0xf7fd52)_0x2f3167[_0x379aad(0x1ff)](_0x2b6071['input'])[_0x379aad(0x1f6)](_0x2b6071[_0x379aad(0x201)],_0x2b6071[_0x379aad(0x1db)]);}async function _0x116b77(_0x6c1e1b,_0x9f1ae2,_0x270463){const _0x433796=_0x26391d;_0x9f1ae2[_0x433796(0x204)]||(_0x9f1ae2[_0x433796(0x204)]=!0x0,c(_0x9f1ae2),_0x270463&&_0x19907b({'key':_0x6c1e1b,'reason':_0x270463,'type':'destroy-start'}),await _0xffc618[_0x433796(0x1f7)][_0x433796(0x1e9)]({'instance':_0x9f1ae2[_0x433796(0x20a)],'key':_0x6c1e1b}));}}function i(_0xe02a33,_0x2d09c9){const _0x15ee1b=_0x3e30;if(!Number[_0x15ee1b(0x1f9)](_0xe02a33)||_0xe02a33<0x0)throw new e(_0x15ee1b(0x1fa),_0x15ee1b(0x1dd));if(!Number[_0x15ee1b(0x219)](_0x2d09c9)||_0x2d09c9<=0x0)throw new e(_0x15ee1b(0x1fa),_0x15ee1b(0x216));}function a(_0x5f535a){const _0xa7cdf1=_0x3e30;if(_0x5f535a['key']['length']===0x0)throw new e(_0xa7cdf1(0x1fa),_0xa7cdf1(0x203));}function _0x338f(){const _0x2b0fd5=['key\x20must\x20not\x20be\x20empty','closed','Instance\x20pool\x20capacity\x20','key','find','1269luWNqW','reason','instance','InstancePoolError','idleTtlMs','create-complete','unref','8cAcTdY','entries','85037RzaFYg','299795nenvKS','push','get','evicted','cache.maxEntries\x20must\x20be\x20a\x20positive\x20integer','splice','create','isSafeInteger','cache','reject','invalidated','cache.idleTtlMs\x20must\x20be\x20a\x20finite\x20non-negative\x20number','maxEntries','set','228010bUWYHU','invalidate','lru','clear','catch','1995424qHcvcK','lastIdleSequence','shift','add','destroy','idleTimer','\x20is\x20occupied\x20by\x20active\x20or\x20loading\x20instances','ttl','name','63OqOUsg','status','1976nDMqBz','now','size','INSTANCE_POOL_CLOSED','785428sfDWRR','INSTANCE_POOL_CAPACITY_EXCEEDED','then','factory','2375034YsPgfe','isFinite','INSTANCE_POOL_INVALID_INPUT','cache-hit','rejected','waiters','create-start','acquire','busy','resolve','delete'];_0x338f=function(){return _0x2b0fd5;};return _0x338f();}function o(_0x6a9d7e,_0x11eb03){return new Promise((_0x1da076,_0x292cf5)=>{const _0x4eb096=_0x3e30;_0x11eb03[_0x4eb096(0x213)]({'input':_0x6a9d7e,'reject':_0x292cf5,'resolve':_0x1da076});});}function _0x3e30(_0x38c47e,_0x1157f4){_0x38c47e=_0x38c47e-0x1db;const _0x338fe4=_0x338f();let _0x3e30ae=_0x338fe4[_0x38c47e];return _0x3e30ae;}function s(_0x5748a8,_0x129e71){const _0x488c24=_0x3e30;for(let _0x23d4c7 of _0x5748a8[_0x488c24(0x217)](0x0))_0x23d4c7[_0x488c24(0x1db)](_0x129e71);}function c(_0x51f066){const _0x492b92=_0x3e30;_0x51f066[_0x492b92(0x1ea)]!==void 0x0&&(clearTimeout(_0x51f066['idleTimer']),delete _0x51f066[_0x492b92(0x1ea)]);}function l(){const _0x2dcffb=_0x3e30;return new e(_0x2dcffb(0x1f3),'Instance\x20pool\x20is\x20closed');}export{e as InstancePoolError,r as createGenericKeyedInstancePool};
|