cancelAsync

fun cancelAsync(reason: JsError? = definedExternally): Promise<Void?>(source)

The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.

MDN Reference