1 | import type { SubchannelRef } from './channelz';
|
2 | import { ConnectivityState } from './connectivity-state';
|
3 | import { Subchannel } from './subchannel';
|
4 | export type ConnectivityStateListener = (subchannel: SubchannelInterface, previousState: ConnectivityState, newState: ConnectivityState, keepaliveTime: number, errorMessage?: string) => void;
|
5 | export type HealthListener = (healthy: boolean) => void;
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export interface SubchannelInterface {
|
16 | getConnectivityState(): ConnectivityState;
|
17 | addConnectivityStateListener(listener: ConnectivityStateListener): void;
|
18 | removeConnectivityStateListener(listener: ConnectivityStateListener): void;
|
19 | startConnecting(): void;
|
20 | getAddress(): string;
|
21 | throttleKeepalive(newKeepaliveTime: number): void;
|
22 | ref(): void;
|
23 | unref(): void;
|
24 | getChannelzRef(): SubchannelRef;
|
25 | isHealthy(): boolean;
|
26 | addHealthStateWatcher(listener: HealthListener): void;
|
27 | removeHealthStateWatcher(listener: HealthListener): void;
|
28 | |
29 |
|
30 |
|
31 | getRealSubchannel(): Subchannel;
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 | realSubchannelEquals(other: SubchannelInterface): boolean;
|
38 | }
|
39 | export declare abstract class BaseSubchannelWrapper implements SubchannelInterface {
|
40 | protected child: SubchannelInterface;
|
41 | private healthy;
|
42 | private healthListeners;
|
43 | constructor(child: SubchannelInterface);
|
44 | private updateHealthListeners;
|
45 | getConnectivityState(): ConnectivityState;
|
46 | addConnectivityStateListener(listener: ConnectivityStateListener): void;
|
47 | removeConnectivityStateListener(listener: ConnectivityStateListener): void;
|
48 | startConnecting(): void;
|
49 | getAddress(): string;
|
50 | throttleKeepalive(newKeepaliveTime: number): void;
|
51 | ref(): void;
|
52 | unref(): void;
|
53 | getChannelzRef(): SubchannelRef;
|
54 | isHealthy(): boolean;
|
55 | addHealthStateWatcher(listener: HealthListener): void;
|
56 | removeHealthStateWatcher(listener: HealthListener): void;
|
57 | protected setHealthy(healthy: boolean): void;
|
58 | getRealSubchannel(): Subchannel;
|
59 | realSubchannelEquals(other: SubchannelInterface): boolean;
|
60 | }
|