1 |
|
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 |
|
11 |
|
12 |
|
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 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 | }
|