1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Host = void 0;
|
4 | const urlModule = require("url");
|
5 | class Host {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 | constructor(url, backoff, options) {
|
12 | this.backoff = backoff;
|
13 | this.options = options;
|
14 | this.url = urlModule.parse(url);
|
15 | }
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | fail() {
|
22 | const value = this.backoff.getDelay();
|
23 | this.backoff = this.backoff.next();
|
24 | return value;
|
25 | }
|
26 | |
27 |
|
28 |
|
29 |
|
30 | success() {
|
31 | this.backoff = this.backoff.reset();
|
32 | }
|
33 | }
|
34 | exports.Host = Host;
|