[whatwg/streams] Cancelling a pipe (#576)

I was wondering, how can I cancel a pipe?

For instance, I have something like this:
```js
let readable = new ReadableStream({…}); // Fetch a 10Mb file
let transform = new ReadableStream({…});
let writable = new WritableStream({…});

readable
  .pipeThrough(transform)
  .pipeTo(writable);
```

I'm trying to cancel this pipe in order to re-start it by fetching at another offset (seeking in the file).
Calling `readable.cancel()` will reject the promise since the reader is locked ("Cannot cancel a stream that already has a reader").
Calling `controller.close()` will also throw errors ("Reader was released and can no longer be used to monitor the stream's closedness" and "Writer was released and can no longer be used to monitor the stream's closedness" multiple times).

Is there something I'm doing wrong?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/576

Received on Friday, 28 October 2016 12:54:56 UTC