![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/rxjs/_esm2015/internal/operators/ |
import { Subject } from '../Subject'; import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe'; export function retryWhen(notifier) { return (source) => source.lift(new RetryWhenOperator(notifier, source)); } class RetryWhenOperator { constructor(notifier, source) { this.notifier = notifier; this.source = source; } call(subscriber, source) { return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source)); } } class RetryWhenSubscriber extends SimpleOuterSubscriber { constructor(destination, notifier, source) { super(destination); this.notifier = notifier; this.source = source; } error(err) { if (!this.isStopped) { let errors = this.errors; let retries = this.retries; let retriesSubscription = this.retriesSubscription; if (!retries) { errors = new Subject(); try { const { notifier } = this; retries = notifier(errors); } catch (e) { return super.error(e); } retriesSubscription = innerSubscribe(retries, new SimpleInnerSubscriber(this)); } else { this.errors = undefined; this.retriesSubscription = undefined; } this._unsubscribeAndRecycle(); this.errors = errors; this.retries = retries; this.retriesSubscription = retriesSubscription; errors.next(err); } } _unsubscribe() { const { errors, retriesSubscription } = this; if (errors) { errors.unsubscribe(); this.errors = undefined; } if (retriesSubscription) { retriesSubscription.unsubscribe(); this.retriesSubscription = undefined; } this.retries = undefined; } notifyNext() { const { _unsubscribe } = this; this._unsubscribe = null; this._unsubscribeAndRecycle(); this._unsubscribe = _unsubscribe; this.source.subscribe(this); } } //# sourceMappingURL=retryWhen.js.map