Skip to content

Commit 9c6765d

Browse files
committed
Document ThrottledOperations.schedule
1 parent d790f1d commit 9c6765d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/server/utilities.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ namespace ts.server {
179179
constructor(private readonly host: ServerHost) {
180180
}
181181

182+
/**
183+
* Wait `number` milliseconds and then invoke `cb`. If, while waiting, schedule
184+
* is called again with the same `operationId`, cancel this operation in favor
185+
* of the new one. (Note that the amount of time the canceled operation had been
186+
* waiting does not affect the amount of time that the new operation waits.)
187+
*/
182188
public schedule(operationId: string, delay: number, cb: () => void) {
183189
const pendingTimeout = this.pendingTimeouts.get(operationId);
184190
if (pendingTimeout) {

0 commit comments

Comments
 (0)