Skip to content

Commit 668b5ae

Browse files
committed
Consolidate LocalitySubchannelAddress definitions
1 parent 29d7b4d commit 668b5ae

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

packages/grpc-js/src/load-balancer-weighted-target.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,12 @@ import { ConnectivityState } from "./channel";
2323
import { ChildLoadBalancerHandler } from "./load-balancer-child-handler";
2424
import { Status } from "./constants";
2525
import { Metadata } from "./metadata";
26+
import { isLocalitySubchannelAddress, LocalitySubchannelAddress } from "./load-balancer-priority";
2627

2728
const TYPE_NAME = 'weighted_target';
2829

2930
const DEFAULT_RETENTION_INTERVAL_MS = 15 * 60 * 1000;
3031

31-
/* These should be imported from load-balancer-priority.ts or factored into
32-
* a separate file */
33-
34-
export type LocalitySubchannelAddress = SubchannelAddress & {
35-
localityPath: string[];
36-
};
37-
38-
export function isLocalitySubchannelAddress(
39-
address: SubchannelAddress
40-
): address is LocalitySubchannelAddress {
41-
return Array.isArray((address as LocalitySubchannelAddress).localityPath);
42-
}
43-
4432
/**
4533
* Represents a picker and a subinterval of a larger interval used for randomly
4634
* selecting an element of a list of these objects.

0 commit comments

Comments
 (0)