let isAborted = falsestream.onAbort(() => { isAborted = true;})while(!isAborted) { await stream.sleep(500); }