UNPKG

@creejs/commons-retrier

Version:
3 lines (2 loc) 21.3 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CommonsLang={})}(this,function(t){"use strict";var e=function(t,...e){if(null==t)throw new TypeError('"target" must not be null or undefined');for(const s of e)if(null!=s)for(const e in s)void 0===t[e]&&(t[e]=s[e]);return t};var s={isNumber:n,isNil:r};function r(t){return null==t}function n(t){return null!=t&&"number"==typeof t}function i(t){return null!=t&&"function"==typeof t.then}var o={assertNumber:l,assertPositive:function(t,e){if(!function(t){return!!n(t)&&t>0}(t))throw new Error(`${e?'"'+e+'" ':" "}Not Positive: ${t}`)},assertNotNegative:function(t,e){if(!function(t){return!!n(t)&&t>=0}(t))throw new Error(`${e?'"'+e+'" ':" "}Not "0 or Positive": ${t}`)},assertFunction:c,assertNotNil:function(t,e){if(r(t))throw new Error((e?'"'+e+'" ':" ")+"Should Not Nil")},assertString:function(t,e){if(!function(t){return null!=t&&"string"==typeof t}(t))throw new Error(`${e?'"'+e+'" ':" "}Not String: type=${typeof t} value=${JSON.stringify(t)}`)}};function a(t,e){if(!Array.isArray(t))throw new Error(`${e?e+"":" "}Not Array: type=${typeof t} value=${JSON.stringify(t)}`)}function l(t,e){if(!n(t))throw new Error(`${e?'"'+e+'" ':" "}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)}function c(t,e){if(!function(t){return"function"==typeof t}(t))throw new Error(`${e?'"'+e+'" ':" "}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)}function h(t,e){if(!i(t))throw new Error(`${e?'"'+e+'" ':" "}Not Promise: type=${typeof t} value=${JSON.stringify(t)}`)}var u={defer:m,delay:function(t,e){n(t)?(e=t,t=Promise.resolve()):null==t&&null==e&&(e=1,t=Promise.resolve()),null!=t&&h(t),l(e=e??1e3);const s=m(),r=Date.now();return t.then((...t)=>{const n=Date.now()-r;n<e?setTimeout(()=>s.resolve(...t),e-n):s.resolve(...t)}).catch(t=>{const n=Date.now()-r;n<e?setTimeout(()=>s.reject(t),e-n):s.reject(t)}),s.promise},timeout:function(t,e,s){h(t),l(e=e??1);const r=m(e,s),n=Date.now();return t.then((...t)=>{Date.now()-n<=e?r.resolve(...t):r.reject(new Error(s??`Promise Timeout: ${e}ms`))}).catch(t=>{!r.resolved&&!r.rejected&&r.reject(t)}),r.promise},allSettled:f,returnValuePromised:_,series:async function(t){a(t);const e=[];for(const s of t)c(s),e.push(await s());return e},seriesAllSettled:async function(t){a(t);const e=[];for(const s of t){c(s);try{e.push({ok:!0,result:await s()})}catch(t){e.push({ok:!1,result:t})}}return e},parallel:async function(t,e=5){if(a(t),l(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>c(t));const s=[];if(t.length<=e){const e=await Promise.all(t.map(t=>_(t)));return s.push(...e),s}const r=[];for(const n of t)if(c(n),r.push(n),r.length>=e){const t=await Promise.all(r.map(t=>_(t)));s.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await Promise.all(r.map(t=>_(t)));s.push(...t)}return s},parallelAllSettled:async function(t,e=5){if(a(t),l(e),e<=0)throw new Error(`Invalid maxParallel: ${e}, should > 0`);t.forEach(t=>c(t));const s=[];if(t.length<=e){const e=await f(t.map(t=>_(t)));return s.push(...e),s}const r=[];for(const n of t)if(c(n),r.push(n),r.length>=e){const t=await f(r.map(t=>_(t)));s.push(...t),r.length=0}if(r.length>0&&r.length<e){const t=await f(r.map(t=>_(t)));s.push(...t)}return s}};function m(t=-1,e){l(t);const s={};let r;return t>=0&&(s.timerHandler=r=setTimeout(()=>{clearTimeout(r),s.timerCleared=!0,s.reject(new Error(e??`Promise Timeout: ${t}ms`))},t),s.timerHandler=r),s.promise=new Promise((t,e)=>{s.resolve=(...e)=>{null!=r&&(clearTimeout(r),s.timerCleared=!0),s.resolved=!0,t(...e)},s.reject=t=>{null!=r&&(clearTimeout(r),s.timerCleared=!0),s.rejected=!0,e(t)}}),s.promise.cancel=()=>{null!=r&&(clearTimeout(r),s.timerCleared=!0),s.rejected=!0,s.canceled=s.promise.canceled=!0,s.reject(new Error("Cancelled"))},s}async function f(t){a(t);const e=await Promise.allSettled(t),s=[];for(const t of e)"fulfilled"===t.status&&s.push({ok:!0,result:t.value}),"rejected"===t.status&&s.push({ok:!1,result:t.reason});return s}function _(t){try{const e=t();return i(e)?e:Promise.resolve(e)}catch(t){return Promise.reject(t)}}const{assertPositive:d,assertNotNegative:w}=o,{isNumber:p}=s;class g{constructor(){this._min=50,this._max=3e4,this._nextInterval=this._min,this._jitter=0}get jitter(){return this._jitter}set jitter(t){w(t,"jitter"),this._jitter=t}copyPolicySettingTo(t){t.range(this._min,this._max),t._nextInterval=this._nextInterval}range(t,e){if(d(t,"min"),d(e,"max"),t>=e)throw new Error("min must < max");return this._min=t,this._nextInterval<this._min&&(this._nextInterval=this._min),this._max=e,this._nextInterval>this._max&&(this._nextInterval=this._max),this}min(t){if(d(t,"min"),t>=this._max)throw new Error("min must < max");return this._min=t,this._nextInterval=this._min,this}max(t){if(d(t,"max"),t<=this._min)throw new Error("max must > min");return this._max=t,this._nextInterval>this._max&&(this._nextInterval=this._max),this}reset(){return this._nextInterval=this._min,this}generate(t){const e=this._nextInterval;return this._increase(t),e}_increase(t){const e=this._next(t);if(!p(e))throw new Error("Generated Next Interval Not Number");const s=this._jitter<=0?e:e+Math.floor(Math.random()*this._jitter);return s<this._min?this._nextInterval=this._min:s>this._max?this._nextInterval=this._max:this._nextInterval=s}_next(t){throw new Error("Not Impled Yet")}}var v={isFunction:y,isNil:x};function y(t){return"function"==typeof t}function x(t){return null==t}function k(t){return null!=t&&"string"==typeof t}var L={assertNumber:function(t,e){if(!function(t){return null!=t&&"number"==typeof t}(t))throw new Error(`${e?'"'+e+'" ':" "}Not Number: type=${typeof t} value=${JSON.stringify(t)}`)},assertFunction:function(t,e){if(!y(t))throw new Error(`${e?'"'+e+'" ':" "}Not Function: type=${typeof t} value=${JSON.stringify(t)}`)},assertNotNil:function(t,e){if(x(t))throw new Error((e?'"'+e+'" ':" ")+"Should Not Nil")},assertString:function(t,e){if(!k(t))throw new Error(`${e?'"'+e+'" ':" "}Not String: type=${typeof t} value=${JSON.stringify(t)}`)},assertStringOrSymbol:function(t,e){if(!k(t)&&!function(t){return null!=t&&"symbol"==typeof t}(t))throw new Error(`${e?'"'+e+'" ':" "}Not String or Symbol: type=${typeof t} value=${JSON.stringify(t)}`)}};const b="DOwner$#$",{assertFunction:E,assertNotNil:N}=L;class S{constructor(t,e,s=!1){N(t,"event"),E(e,"callback"),this._event=t,this._callback=e,this._isOnce=!!s,this._owner=void 0}set owner(t){this._owner=t}get owner(){return this._owner===b?void 0:this._owner}get event(){return this._event}get isOnce(){return this._isOnce}isSameCallback(t){return this._callback===t}get callback(){return this._callback}invoke(...t){try{return this._callback(...t)}finally{if(this._isOnce)try{this._event._remove(this)}catch(t){console.warn(t)}}}listener(...t){return this.invoke(...t)}}const{isFunction:O,isNil:R}=v,{assertStringOrSymbol:T,assertFunction:$}=L;class P{static get DefaultOwner(){return b}constructor(t){T(t,"eventName"),this._name=t,this._callbacks=new Set,this._listeners=[],this._callback2Listeners=new Map,this._listener2Owner=new Map,this._owner2Listeners=new Map}get name(){return this._name}isEmpty(){return 0===this._callbacks.size}rawListeners(){return[...this._listeners]}listenerCount(t){return null==t?this._listeners.length:this._callback2Listeners.get(t)?.size??0}callbacks(){return[...this.rawListeners().map(t=>t.callback)]}emit(...t){if(0===this._listeners.length)return!1;for(const e of[...this._listeners])e.invoke(...t);return!0}hasListener(t){return!!O(t)&&this._callbacks.has(t)}hasOwner(t){return!R(t)&&this._owner2Listeners.has(t)}addListener(t,e){return this._addListener(t,e,!1,!1)}prependListener(t,e){return this._addListener(t,e,!1,!0)}addOnceListener(t,e){return this._addListener(t,e,!0,!1)}prependOnceListener(t,e){return this._addListener(t,e,!0,!0)}_addListener(t,e,s,r){if(R(t))return!1;$(t),this._callbacks.has(t)||this._callbacks.add(t),e=e??b;const n=new S(this,t,s);n.owner=e,r?this._listeners.unshift(n):this._listeners.push(n),this._listener2Owner.set(n,e);let i=this._callback2Listeners.get(t);null==i&&(i=new Set,this._callback2Listeners.set(t,i)),i.add(n);let o=this._owner2Listeners.get(e);return null==o&&(o=new Set,this._owner2Listeners.set(e,o)),o.add(n),!0}removeListener(t){if(R(t))return!1;if(!this._callbacks.has(t))return!1;this._callbacks.delete(t);const e=this._callback2Listeners.get(t);if(null==e)return!1;this._callback2Listeners.delete(t);for(const t of e){-1!==this._listeners.indexOf(t)&&this._listeners.splice(this._listeners.indexOf(t),1);const e=this._listener2Owner.get(t);if(null==e)continue;this._listener2Owner.delete(t);const s=this._owner2Listeners.get(e);null!=s&&(s.delete(t),0===s.size&&this._owner2Listeners.delete(e))}return!0}_remove(t){const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1);const{callback:s}=t,r=this._callback2Listeners.get(s);null!=r&&(r.delete(t),0===r.size&&(this._callback2Listeners.delete(s),this._callbacks.delete(s)));const n=this._listener2Owner.get(t);if(null==n)return;this._listener2Owner.delete(t);const i=this._owner2Listeners.get(n);null!=i&&(i.delete(t),0===i.size&&this._owner2Listeners.delete(n))}removeAllListeners(t){if(R(t))return this._callbacks.clear(),this._listeners.length=0,this._callback2Listeners.clear(),this._listener2Owner.clear(),this._owner2Listeners.clear(),this;const e=this._owner2Listeners.get(t);if(null==e)return this;this._owner2Listeners.delete(t);for(const t of e){-1!==this._listeners.indexOf(t)&&this._listeners.splice(this._listeners.indexOf(t),1),this._listener2Owner.delete(t);const{callback:e}=t,s=this._callback2Listeners.get(e);null!=s&&(s.delete(t),0===s.size&&(this._callback2Listeners.delete(e),this._callbacks.delete(e)))}return this}}const{isNil:F}=v,{assertString:I,assertFunction:j,assertNumber:M,assertStringOrSymbol:C,assertNotNil:A}=L,B=["on","once","addListener","prependListener","prependOnceListener","off","offAll","offOwner","removeAllListeners","removeListener","emit","setMaxListeners","getMaxListeners","hasOwner","listeners","listenerCount","eventNames","rawListeners"];let D=10;class J{static mixin(t){const e=new J;t.__emitter=e;for(const s of B){const r=e[s];t[s]=r.bind(e)}return t}static get defaultMaxListeners(){return D}static set defaultMaxListeners(t){M(t),D=t??10}constructor(){this._name2Event=new Map,this._maxListeners=D}addListener(t,e,s){return this.on(t,e,s)}prependListener(t,e,s){return I(t),j(e),this._checkMaxListeners(t),this._getOrCreateEvent(t).prependListener(e,s),this}prependOnceListener(t,e,s){return I(t),j(e),this._checkMaxListeners(t),this._getOrCreateEvent(t).prependOnceListener(e,s),this}emit(t,...e){const s=this._name2Event.get(t);return null!=s&&!s.isEmpty()&&(s.emit(...e),!0)}eventNames(){return[...this._name2Event.keys()]}getMaxListeners(){return this._maxListeners}listenerCount(t,e){C(t,"eventName");const s=this._name2Event.get(t);return null==s||s.isEmpty()?0:s.listenerCount(e)}listeners(t){C(t,"eventName");const e=this._name2Event.get(t);return null==e||e.isEmpty()?[]:e.callbacks()}off(t,e){const s=this._name2Event.get(t);return null==s?this:(s.removeListener(e),s.isEmpty()?(this._name2Event.delete(t),this):this)}offAll(t,e){C(t,"eventName");const s=this._name2Event.get(t);return null==s?this:(s.removeAllListeners(e),s.isEmpty()?(this._name2Event.delete(t),this):this)}offOwner(t){A(t,"owner");const e=[...this._name2Event.values()];for(const s of e)s.removeAllListeners(t),s.isEmpty()&&this._name2Event.delete(s.name);return this}on(t,e,s){return I(t),j(e),this._checkMaxListeners(t),this._getOrCreateEvent(t).addListener(e,s),this}_checkMaxListeners(t){let e=0;0!==this._maxListeners&&this._maxListeners!==1/0&&(e=this.listenerCount(t))>=this._maxListeners&&console.warn(`maxlistenersexceededwarning: Possible EventEmitter memory leak detected. ${e} ${t} listeners added to [${this}]. Use emitter.setMaxListeners() to increase limit`)}once(t,e,s){return I(t),j(e),this._getOrCreateEvent(t).addOnceListener(e,s),this}rawListeners(t){return this._name2Event.get(t)?.rawListeners()||[]}removeAllListeners(t,e){return this.offAll(t,e)}removeListener(t,e){return this.off(t,e)}setMaxListeners(t){if(M(t),t<0)throw new RangeError("maxListeners must >=0");return this._maxListeners=t,this}_getOrCreateEvent(t){if(this._name2Event.has(t))return this._name2Event.get(t);const e=new P(t);return this._name2Event.set(t,e),e}hasOwner(t){if(F(t))return!1;for(const e of this._name2Event.values())if(e.hasOwner(t))return!0;return!1}}var z={Start:"start",Retry:"retry",Success:"success",Failure:"failure",Timeout:"timeout",TaskTimeout:"task-timeout",Stop:"stop",Completed:"complete",MaxRetries:"max-retries"};const{assertPositive:H}=o;class G extends g{constructor(t){super(),H(t,"interval"),this._interval=t}set interval(t){H(t,"interval"),this._interval=t}get interval(){return this._interval}_next(t){return this.interval}}const{assertPositive:U}=o;class V extends g{constructor(t){super(),U(t,"increasement"),this._increasement=t}set increasement(t){U(t,"increasement"),this._increasement=t}get increasement(){return this._increasement}_next(t){return this._nextInterval>=this._max?this._max:this._nextInterval+this.increasement}}const{assertPositive:Y}=o;class q extends g{constructor(t){if(super(),Y(t,"factor"),t<1)throw new Error("factor must be >= 1");this._factor=t}set factor(t){if(Y(t,"factor"),t<1)throw new Error("factor must be >= 1");this._factor=t}get factor(){return this._factor}_next(t){return this._nextInterval>=this._max?this._max:this._nextInterval*this.factor}}const{assertPositive:K}=o;class Q extends g{constructor(t){super(),K(t,"stepLength"),this._stepLength=t,this.increasement=t}set stepLength(t){K(t,"stepLength"),this._stepLength=t,this.increasement=t}get stepLength(){return this._stepLength}_next(t){const e=this._nextInterval+this.increasement;return e>=this._max?(this.increasement=-this.stepLength,this._max):e<=this._min?(this.increasement=this.stepLength,this._min):e}}const{assertNotNil:W,assertFunction:X}=o;class Z{constructor(t,e){W(t,"retrier"),X(e,"task"),this.retrier=t,this.task=e,this.result=void 0,this.error=void 0}get failed(){return null!=this.error}get succeeded(){return null==this.error}async execute(t,e,s){try{this.result=await this.task(t,e,s),this.error=void 0}catch(t){this.error=t}}dispose(){this.retrier=void 0}}class tt extends Z{static isAlwaysTask(t){return t instanceof tt}constructor(t,e,s){super(t,e),this.resetPolicy=s}async execute(t,e,s){await super.execute(t,e,s),this.succeeded&&this.resetPolicy&&this.retrier.resetRetryPolicy()}}const{assertNotNegative:et}=o;class st extends G{constructor(t,e=500){super(t),et(e,"jitter"),this._jitter=e??500}}const{assertNotNegative:rt}=o;class nt extends q{constructor(t=500){super(2),rt(t,"jitter"),this._jitter=t??500}}const{assertNotNegative:it}=o;class ot extends V{constructor(t,e=500){super(t),it(e,"jitter"),this._jitter=e??500}}const{assertPositive:at,assertString:lt,assertFunction:ct,assertNumber:ht}=o,{isNil:ut}=s,mt="!#@%$&^*";class ft{constructor(t){J.mixin(this),this._policy=new G(t??1e3),this._maxRetries=3,this._currentRetries=1,this._timeout=12e4,this._taskTimeout=2e3,this._name="unamed",this._taskingFlag=void 0,this._breakFlag=void 0,this._breakReason=void 0}get running(){return!ut(this._taskingFlag)}name(t){return lt(t,"retrierName"),this._name=t,this}infinite(){return this._maxRetries=1/0,this}times(t){return this.maxRetries(t)}maxRetries(t){return at(t,"maxRetries"),this._maxRetries=t,this}min(t){return this._policy.min(t),this}max(t){return this._policy.max(t),this}range(t,e){return this._policy.range(t,e),this}fixedInterval(t){const e=this._policy;if(e instanceof G)return e.interval=t,this;const s=new G(t);return e?.copyPolicySettingTo(s),s.reset(),this._policy=s,this}fixedBackoff(t,e=500){const s=this._policy;if(s instanceof G)return s.interval=t,s.jitter=e,this;const r=new st(t,e);return s?.copyPolicySettingTo(r),r.reset(),this._policy=r,this}fixedIncrease(t){const e=this._policy;if(e instanceof V)return e.increasement=t,this;const s=new V(t);return e?.copyPolicySettingTo(s),s.reset(),this._policy=s,this}linearBackoff(t,e=500){const s=this._policy;if(s instanceof ot)return s.increasement=t,s.jitter=e,this;const r=new ot(t,e);return s?.copyPolicySettingTo(r),r.reset(),this._policy=r,this}factorIncrease(t){const e=this._policy;if(e instanceof q)return e.factor=t,this;const s=new q(t);return e?.copyPolicySettingTo(s),s.reset(),this._policy=s,this}exponentialBackoff(t=500){const e=this._policy;if(e instanceof nt)return e.jitter=t,this;const s=new nt(t);return e?.copyPolicySettingTo(s),s.reset(),this._policy=s,this}shuttleInterval(t){const e=this._policy;if(e instanceof Q)return e.stepLength=t,this;const s=new Q(t);return e?.copyPolicySettingTo(s),s.reset(),this._policy=s,this}taskTimeout(t){return at(t,"timeout"),this._taskTimeout=t,this}timeout(t){return ht(t,"timeout"),this._timeout=t,this}task(t){return ct(t,"task"),this._task=new Z(this,t),this}retry(t){return this.task(t),this}always(t,e=!1){return this._task=new tt(this,t,e),this}async start(){if(null==this._task)throw new Error("No Task to Retry");if(null!=this._taskingFlag)return this._taskingFlag.promise;const t=Date.now();let e=null;this.emit(z.Start,t),this._taskingFlag=u.defer();let s=null;for(;;){if(null!=this._breakFlag){this._taskingFlag.reject(this._breakReason);break}if(s=Date.now()-t,!_t(this._timeout)&&s>=this._timeout){if(this.emit(z.Timeout,this._currentRetries,s,this._timeout),tt.isAlwaysTask(this._task)){this._taskingFlag.resolve();break}this._taskingFlag.reject(e??new Error(`Timeout "${this._timeout}" Exceeded`));break}this.emit(z.Retry,this._currentRetries,s);const r=this._task,n=this._policy.generate(this._currentRetries);try{try{await u.timeout(r.execute(this._currentRetries,s,n),this._taskTimeout,mt)}catch(t){throw t.message===mt&&this.emit(z.TaskTimeout,this._currentRetries,s,this._taskTimeout),t}if(r.failed)throw e=r.error,r.error;const t=r.result;if(this.emit(z.Success,t,this._currentRetries,s),!tt.isAlwaysTask(r)){this._taskingFlag.resolve(t);break}}catch(t){this.emit(z.Failure,t,this._currentRetries,s)}const i=++this._currentRetries;if(this._currentRetries>this._maxRetries){if(this.emit(z.MaxRetries,i,this._maxRetries),tt.isAlwaysTask(r)){this._taskingFlag.resolve();break}this._taskingFlag.reject(e??new Error(`Max Retries Exceeded, Retring ${this._currentRetries} times > max ${this._maxRetries}`));break}await u.delay(n)}return this._taskingFlag.promise.finally(()=>{this.resetRetryPolicy(),this._taskingFlag=void 0;const e=Date.now()-t;this.emit(z.Completed,this._currentRetries,e)}),this._taskingFlag.promise}async stop(t){if(this.emit(z.Stop,t),null!=this._taskingFlag)return null!=this._breakFlag||(this._breakFlag=u.defer(),this._breakReason=t??new Error("Manually Stop"),this.once(z.Completed,()=>{this._breakFlag.resolve()}),this._breakFlag.promise.finally(()=>{this._breakFlag=void 0,this._breakReason=void 0})),this._breakFlag.promise}resetRetryPolicy(){this._policy.reset()}onRetry(t){return this.on(z.Retry,t),this}onError(t){return this.on(z.Error,t),this}onFailure(t){return this.on(z.Failure,t),this}onSuccess(t){return this.on(z.Success,t),this}onStart(t){return this.on(z.Start,t),this}onStop(t){return this.on(z.Stop,t),this}onTimeout(t){return this.on(z.Timeout,t),this}onTaskTimeout(t){return this.on(z.TaskTimeout,t),this}onCompleted(t){return this.on(z.Completed,t),this}onMaxRetries(t){return this.on(z.MaxRetries,t),this}}function _t(t){return t<=0||t===1/0}function dt(t){const e=new ft;return e.name(t),e}function wt(){const t=new ft;return t.infinite(),t}function pt(t){const e=new ft;return e.times(t),e}function gt(t){const e=new ft;return e.maxRetries(t),e}function vt(t){const e=new ft;return e.min(t),e}function yt(t){const e=new ft;return e.max(t),e}function xt(t,e){const s=new ft;return s.range(t,e),s}function kt(t){const e=new ft;return e.fixedInterval(t),e}function Lt(t,e=500){const s=new ft;return s.fixedBackoff(t,e),s}function bt(t){const e=new ft;return e.fixedIncrease(t),e}function Et(t,e=500){const s=new ft;return s.linearBackoff(t,e),s}function Nt(t){const e=new ft;return e.factorIncrease(t),e}function St(t=500){const e=new ft;return e.exponentialBackoff(t),e}function Ot(t){const e=new ft;return e.shuttleInterval(t),e}function Rt(t){const e=new ft;return e.timeout(t),e}function Tt(t){const e=new ft;return e.taskTimeout(t),e}function $t(t){const e=new ft;return e.task(t),e.start()}var Pt={name:dt,infinite:wt,times:pt,maxRetries:gt,min:vt,max:yt,range:xt,fixedInterval:kt,fixedBackoff:Lt,fixedIncrease:bt,linearBackoff:Et,factorIncrease:Nt,exponentialBackoff:St,shuttleInterval:Ot,timeout:Rt,taskTimeout:Tt,start:$t};e(ft,Pt);var Ft={Policy:g,Retrier:ft,Event:z,RetrierFactory:Pt,...Pt};t.Event=z,t.Policy=g,t.Retrier=ft,t.RetrierFactory=Pt,t.default=Ft,t.exponentialBackoff=St,t.factorIncrease=Nt,t.fixedBackoff=Lt,t.fixedIncrease=bt,t.fixedInterval=kt,t.infinite=wt,t.linearBackoff=Et,t.max=yt,t.maxRetries=gt,t.min=vt,t.name=dt,t.range=xt,t.shuttleInterval=Ot,t.start=$t,t.taskTimeout=Tt,t.timeout=Rt,t.times=pt,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=index.min.js.map