resolving-load-balancer.d.ts
2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { ChannelControlHelper, LoadBalancer, LoadBalancingConfig } from './load-balancer';
import { ConfigSelector } from './resolver';
import { StatusObject } from './call-stream';
import { SubchannelAddress } from './subchannel';
import { GrpcUri } from './uri-parser';
import { ChannelOptions } from './channel-options';
export interface ResolutionCallback {
(configSelector: ConfigSelector): void;
}
export interface ResolutionFailureCallback {
(status: StatusObject): void;
}
export declare class ResolvingLoadBalancer implements LoadBalancer {
private readonly target;
private readonly channelControlHelper;
private readonly channelOptions;
private readonly onSuccessfulResolution;
private readonly onFailedResolution;
/**
* The resolver class constructed for the target address.
*/
private innerResolver;
private childLoadBalancer;
private latestChildState;
private latestChildPicker;
/**
* This resolving load balancer's current connectivity state.
*/
private currentState;
private readonly defaultServiceConfig;
/**
* The service config object from the last successful resolution, if
* available. A value of null indicates that we have not yet received a valid
* service config from the resolver.
*/
private previousServiceConfig;
/**
* The backoff timer for handling name resolution failures.
*/
private readonly backoffTimeout;
/**
* Indicates whether we should attempt to resolve again after the backoff
* timer runs out.
*/
private continueResolving;
/**
* Wrapper class that behaves like a `LoadBalancer` and also handles name
* resolution internally.
* @param target The address of the backend to connect to.
* @param channelControlHelper `ChannelControlHelper` instance provided by
* this load balancer's owner.
* @param defaultServiceConfig The default service configuration to be used
* if none is provided by the name resolver. A `null` value indicates
* that the default behavior should be the default unconfigured behavior.
* In practice, that means using the "pick first" load balancer
* implmentation
*/
constructor(target: GrpcUri, channelControlHelper: ChannelControlHelper, channelOptions: ChannelOptions, onSuccessfulResolution: ResolutionCallback, onFailedResolution: ResolutionFailureCallback);
private updateResolution;
private updateState;
private handleResolutionFailure;
exitIdle(): void;
updateAddressList(addressList: SubchannelAddress[], lbConfig: LoadBalancingConfig | null): void;
resetBackoff(): void;
destroy(): void;
getTypeName(): string;
}