influx 5.0.6 → 5.0.7

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/lib/src/host.d.ts CHANGED
@@ -1,26 +1,26 @@
1
- /// <reference types="node" />
2
- import { RequestOptions } from 'https';
3
- import * as urlModule from 'url';
4
- import { IBackoffStrategy } from './backoff/backoff';
5
- export declare class Host {
6
- private backoff;
7
- readonly options: RequestOptions;
8
- readonly url: urlModule.Url;
9
- /**
10
- * Creates a new Host instance.
11
- * @param {String} url
12
- * @param {IBackoffStrategy} backoff
13
- */
14
- constructor(url: string, backoff: IBackoffStrategy, options: RequestOptions);
15
- /**
16
- * Marks a failure on the host and returns the length of time it
17
- * should be removed from the pool
18
- * @return {Number} removal time in milliseconds
19
- */
20
- fail(): number;
21
- /**
22
- * Should be called when a successful operation is run against the host.
23
- * It resets the host's backoff strategy.
24
- */
25
- success(): void;
26
- }
1
+ /// <reference types="node" />
2
+ import { RequestOptions } from 'https';
3
+ import * as urlModule from 'url';
4
+ import { IBackoffStrategy } from './backoff/backoff';
5
+ export declare class Host {
6
+ private backoff;
7
+ readonly options: RequestOptions;
8
+ readonly url: urlModule.Url;
9
+ /**
10
+ * Creates a new Host instance.
11
+ * @param {String} url
12
+ * @param {IBackoffStrategy} backoff
13
+ */
14
+ constructor(url: string, backoff: IBackoffStrategy, options: RequestOptions);
15
+ /**
16
+ * Marks a failure on the host and returns the length of time it
17
+ * should be removed from the pool
18
+ * @return {Number} removal time in milliseconds
19
+ */
20
+ fail(): number;
21
+ /**
22
+ * Should be called when a successful operation is run against the host.
23
+ * It resets the host's backoff strategy.
24
+ */
25
+ success(): void;
26
+ }
package/lib/src/host.js CHANGED
@@ -1,34 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var urlModule = require("url");
4
- var Host = (function () {
5
- /**
6
- * Creates a new Host instance.
7
- * @param {String} url
8
- * @param {IBackoffStrategy} backoff
9
- */
10
- function Host(url, backoff, options) {
11
- this.backoff = backoff;
12
- this.options = options;
13
- this.url = urlModule.parse(url);
14
- }
15
- /**
16
- * Marks a failure on the host and returns the length of time it
17
- * should be removed from the pool
18
- * @return {Number} removal time in milliseconds
19
- */
20
- Host.prototype.fail = function () {
21
- var value = this.backoff.getDelay();
22
- this.backoff = this.backoff.next();
23
- return value;
24
- };
25
- /**
26
- * Should be called when a successful operation is run against the host.
27
- * It resets the host's backoff strategy.
28
- */
29
- Host.prototype.success = function () {
30
- this.backoff = this.backoff.reset();
31
- };
32
- return Host;
33
- }());
34
- exports.Host = Host;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var urlModule = require("url");
4
+ var Host = (function () {
5
+ /**
6
+ * Creates a new Host instance.
7
+ * @param {String} url
8
+ * @param {IBackoffStrategy} backoff
9
+ */
10
+ function Host(url, backoff, options) {
11
+ this.backoff = backoff;
12
+ this.options = options;
13
+ this.url = urlModule.parse(url);
14
+ }
15
+ /**
16
+ * Marks a failure on the host and returns the length of time it
17
+ * should be removed from the pool
18
+ * @return {Number} removal time in milliseconds
19
+ */
20
+ Host.prototype.fail = function () {
21
+ var value = this.backoff.getDelay();
22
+ this.backoff = this.backoff.next();
23
+ return value;
24
+ };
25
+ /**
26
+ * Should be called when a successful operation is run against the host.
27
+ * It resets the host's backoff strategy.
28
+ */
29
+ Host.prototype.success = function () {
30
+ this.backoff = this.backoff.reset();
31
+ };
32
+ return Host;
33
+ }());
34
+ exports.Host = Host;