Re: [whatwg/streams] TransformStream cleanup using "Transformer.cancel" (PR #1283)

> * Is `cancel` the right name? Mirrors `ReadableStream`, but we use `abort` for `WritableStream`.

Since it's used for both the `cancel` and `abort` cases, it might be good to come up with a third name to avoid confusion. `stop` is one possibility.

> * Is the immediate cancellation behaviour correct?
>   
>   * Ie should call the `cancel` hook before or after cancelling the underlying streams?
>   * Calling it before means that current behaviour is changed (number of microticks from `readable.cancel()` to the `writable` actually being aborted). This is the current behaviour.
>   * Calling it after means that you can not modify the reason passed to the other side using the `cancel` hook. This is different to `abort` and `cancel` hooks in `WritableStream` and `ReadableStream` respectively.

Interesting. Calling it before would be better in terms of consistency with the other APIs. I personally think that changing the number of microticks is an acceptable breakage, but others may disagree.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1283#issuecomment-1584336227
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/pull/1283/c1584336227@github.com>

Received on Friday, 9 June 2023 10:17:52 UTC