Skip to content

Commit ea5c18d

Browse files
committed
grpc-js: Switch Timer type to Timeout
1 parent 004a506 commit ea5c18d

10 files changed

+14
-14
lines changed

packages/grpc-js/src/backoff-timeout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class BackoffTimeout {
6363
* to an object representing a timer that has ended, but it can still be
6464
* interacted with without error.
6565
*/
66-
private timerId: NodeJS.Timer;
66+
private timerId: NodeJS.Timeout;
6767
/**
6868
* Indicates whether the timer is currently running.
6969
*/

packages/grpc-js/src/internal-channel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class InternalChannel {
166166
* the invariant is that callRefTimer is reffed if and only if pickQueue
167167
* is non-empty.
168168
*/
169-
private readonly callRefTimer: NodeJS.Timer;
169+
private readonly callRefTimer: NodeJS.Timeout;
170170
private configSelector: ConfigSelector | null = null;
171171
/**
172172
* This is the error from the name resolver if it failed most recently. It
@@ -182,7 +182,7 @@ export class InternalChannel {
182182
new Set();
183183

184184
private callCount = 0;
185-
private idleTimer: NodeJS.Timer | null = null;
185+
private idleTimer: NodeJS.Timeout | null = null;
186186
private readonly idleTimeoutMs: number;
187187

188188
// Channelz info

packages/grpc-js/src/load-balancer-outlier-detection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export class OutlierDetectionLoadBalancer implements LoadBalancer {
507507
private childBalancer: ChildLoadBalancerHandler;
508508
private addressMap: Map<string, MapEntry> = new Map<string, MapEntry>();
509509
private latestConfig: OutlierDetectionLoadBalancingConfig | null = null;
510-
private ejectionTimer: NodeJS.Timer;
510+
private ejectionTimer: NodeJS.Timeout;
511511
private timerStartTime: Date | null = null;
512512

513513
constructor(channelControlHelper: ChannelControlHelper) {

packages/grpc-js/src/resolver-dns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class DnsResolver implements Resolver {
9696
private defaultResolutionError: StatusObject;
9797
private backoff: BackoffTimeout;
9898
private continueResolving = false;
99-
private nextResolutionTimer: NodeJS.Timer;
99+
private nextResolutionTimer: NodeJS.Timeout;
100100
private isNextResolutionTimerRunning = false;
101101
private isServiceConfigEnabled = true;
102102
constructor(

packages/grpc-js/src/resolving-call.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class ResolvingCall implements Call {
5353
private deadline: Deadline;
5454
private host: string;
5555
private statusWatchers: ((status: StatusObject) => void)[] = [];
56-
private deadlineTimer: NodeJS.Timer = setTimeout(() => {}, 0);
56+
private deadlineTimer: NodeJS.Timeout = setTimeout(() => {}, 0);
5757
private filterStack: FilterStack | null = null;
5858

5959
constructor(

packages/grpc-js/src/retrying-call.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export class RetryingCall implements Call {
194194
* Number of attempts so far
195195
*/
196196
private attempts = 0;
197-
private hedgingTimer: NodeJS.Timer | null = null;
197+
private hedgingTimer: NodeJS.Timeout | null = null;
198198
private committedCallIndex: number | null = null;
199199
private initialRetryBackoffSec = 0;
200200
private nextRetryBackoffSec = 0;

packages/grpc-js/src/server-call.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ export class Http2ServerCallStream<
408408
ResponseType
409409
> extends EventEmitter {
410410
cancelled = false;
411-
deadlineTimer: NodeJS.Timer | null = null;
411+
deadlineTimer: NodeJS.Timeout | null = null;
412412
private statusSent = false;
413413
private deadline: Deadline = Infinity;
414414
private wantTrailers = false;

packages/grpc-js/src/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,8 +1079,8 @@ export class Server {
10791079
);
10801080
this.sessionChildrenTracker.refChild(channelzRef);
10811081
}
1082-
let connectionAgeTimer: NodeJS.Timer | null = null;
1083-
let connectionAgeGraceTimer: NodeJS.Timer | null = null;
1082+
let connectionAgeTimer: NodeJS.Timeout | null = null;
1083+
let connectionAgeGraceTimer: NodeJS.Timeout | null = null;
10841084
let sessionClosedByServer = false;
10851085
if (this.maxConnectionAgeMs !== UNLIMITED_CONNECTION_AGE_MS) {
10861086
// Apply a random jitter within a +/-10% range
@@ -1115,7 +1115,7 @@ export class Server {
11151115
}
11161116
}, this.maxConnectionAgeMs + jitter).unref?.();
11171117
}
1118-
const keeapliveTimeTimer: NodeJS.Timer | null = setInterval(() => {
1118+
const keeapliveTimeTimer: NodeJS.Timeout | null = setInterval(() => {
11191119
const timeoutTImer = setTimeout(() => {
11201120
sessionClosedByServer = true;
11211121
if (this.channelzEnabled) {

packages/grpc-js/src/subchannel-pool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class SubchannelPool {
4545
/**
4646
* A timer of a task performing a periodic subchannel cleanup.
4747
*/
48-
private cleanupTimer: NodeJS.Timer | null = null;
48+
private cleanupTimer: NodeJS.Timeout | null = null;
4949

5050
/**
5151
* A pool of subchannels use for making connections. Subchannels with the

packages/grpc-js/src/transport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Http2Transport implements Transport {
108108
/**
109109
* Timer reference for timeout that indicates when to send the next ping
110110
*/
111-
private keepaliveTimerId: NodeJS.Timer | null = null;
111+
private keepaliveTimerId: NodeJS.Timeout | null = null;
112112
/**
113113
* Indicates that the keepalive timer ran out while there were no active
114114
* calls, and a ping should be sent the next time a call starts.
@@ -117,7 +117,7 @@ class Http2Transport implements Transport {
117117
/**
118118
* Timer reference tracking when the most recent ping will be considered lost
119119
*/
120-
private keepaliveTimeoutId: NodeJS.Timer | null = null;
120+
private keepaliveTimeoutId: NodeJS.Timeout | null = null;
121121
/**
122122
* Indicates whether keepalive pings should be sent without any active calls
123123
*/

0 commit comments

Comments
 (0)