src/vs/platform/remote/common/remoteAgentConnection.ts/PromiseWithTimeout/constructor
class PromiseWithTimeout:	constructor(timeoutCancellationToken: CancellationToken) {
		this._state = 'pending';
		this._disposables = new DisposableStore();
		this.promise = new Promise<T>((resolve, reject) => {
			this._resolvePromise = resolve;
			this._rejectPromise = reject;
		});

		if (timeoutCancellationToken.isCancellationRequested) {
			this._timeout();
		} else {
			this._disposables.add(timeoutCancellationToken.onCancellationRequested(() => this._timeout()));
		}
	}