1 | import { ChannelOptions } from './channel-options';
|
2 | import { Subchannel } from './subchannel';
|
3 | import { SubchannelAddress } from './subchannel-address';
|
4 | import { ChannelCredentials } from './channel-credentials';
|
5 | import { GrpcUri } from './uri-parser';
|
6 | export declare class SubchannelPool {
|
7 | private pool;
|
8 | |
9 |
|
10 |
|
11 | private cleanupTimer;
|
12 | |
13 |
|
14 |
|
15 |
|
16 | constructor();
|
17 | /**
|
18 | * Unrefs all unused subchannels and cancels the cleanup task if all
|
19 | * subchannels have been unrefed.
|
20 | */
|
21 | unrefUnusedSubchannels(): void;
|
22 | /**
|
23 | * Ensures that the cleanup task is spawned.
|
24 | */
|
25 | ensureCleanupTask(): void;
|
26 | /**
|
27 | * Get a subchannel if one already exists with exactly matching parameters.
|
28 | * Otherwise, create and save a subchannel with those parameters.
|
29 | * @param channelTarget
|
30 | * @param subchannelTarget
|
31 | * @param channelArguments
|
32 | * @param channelCredentials
|
33 | */
|
34 | getOrCreateSubchannel(channelTargetUri: GrpcUri, subchannelTarget: SubchannelAddress, channelArguments: ChannelOptions, channelCredentials: ChannelCredentials): Subchannel;
|
35 | }
|
36 | /**
|
37 | * Get either the global subchannel pool, or a new subchannel pool.
|
38 | * @param global
|
39 | */
|
40 | export declare function getSubchannelPool(global: boolean): SubchannelPool;
|