637
638
public writeMessage(data: VSBuffer, options: FrameOptions): void {
639
>
this._writeQueue.push({ data, options });
ipc.net.ts
640
>
this._processWriteQueue();
641
>
}
642
643
private _isProcessingWriteQueue = false;
644
private async _processWriteQueue(): Promise<void> {
645
>
if (this._isProcessingWriteQueue) {
ipc.net.ts
646
return;
647
}
648
>
this._isProcessingWriteQueue = true;
ipc.net.ts
649
>
while (this._writeQueue.length > 0) {
650
>
const { data, options } = this._writeQueue.shift()!;
651
>
if (this._zlibDeflateStream && options.compressed) {
652
const compressedData = await this._deflateMessage(this._zlibDeflateStream, data);
653
this._writeFn(compressedData, options);
655
this._writeFn(data, { ...options, compressed: false });
656
}
658
>
this._isProcessingWriteQueue = false;
659
>
this._onDidFinishProcessingWriteQueue.fire();
660
>
}
661
662
public isProcessingWriteQueue(): boolean {