src/vs/base/common/async.ts/ResourceQueue/whenDrained
class ResourceQueue:	async whenDrained(): Promise<void> {
		if (this.isDrained()) {
			return;
		}

		const promise = new DeferredPromise<void>();
		this.drainers.add(promise);

		return promise.p;
	}