| 9752 | this.handler.onError(err3); |
| 9753 | } |
| 9754 | } |
| 9755 | } |
| 9756 | }; |
| 9757 | module.exports = RetryHandler; |
| 9758 | } |
| 9759 | }); |
| 9760 | |
| 9761 | // |
| 9762 | var require_retry_agent = __commonJS({ |
| 9763 | ""(exports, module) { |
| 9764 | "use strict"; |
| 9765 | var Dispatcher = require_dispatcher(); |
| 9766 | var RetryHandler = require_retry_handler(); |
| 9767 | var _agent, _options; |
| 9768 | var RetryAgent = class extends Dispatcher { |
| 9769 | constructor(agent, options = {}) { |
| 9770 | super(options); |
| 9771 | __privateAdd(this, _agent, null); |
| 9772 | __privateAdd(this, _options, null); |
| 9773 | __privateSet(this, _agent, agent); |
| 9774 | __privateSet(this, _options, options); |
| 9775 | } |
| 9776 | dispatch(opts, handler) { |
| 9777 | const retry = new RetryHandler(__spreadProps(__spreadValues({}, opts), { |
| 9778 | retryOptions: __privateGet(this, _options) |
| 9779 | }), { |
| 9780 | dispatch: __privateGet(this, _agent).dispatch.bind(__privateGet(this, _agent)), |
| 9781 | handler |
| 9782 | }); |
| 9783 | return __privateGet(this, _agent).dispatch(opts, retry); |
| 9784 | } |
| 9785 | close() { |
| 9786 | return __privateGet(this, _agent).close(); |
| 9787 | } |
| 9788 | destroy() { |
| 9789 | return __privateGet(this, _agent).destroy(); |
| 9790 | } |
| 9791 | }; |
| 9792 | _agent = new WeakMap(); |
| 9793 | _options = new WeakMap(); |