You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wait until every chunk that has been read has been written
I think it's ambiguous whether this waits when no chunks have been read or not. This is visible because the behaviour of a pipeTo() that starts when one or both sides is closed or errored is tightly specified, and because waiting is detectable via microtask execution.
The text was updated successfully, but these errors were encountered:
Hmm. I'm not sure I'm happy that we prescribe a particular number of microtasks in such cases, especially since we're semi-intentionally using ambiguous wording like "wait".
Maybe we could make my above thoughts explicit, by inserting something like
Optionally, wait an additional user-agent determined amount of time. NOTE: this is intended to help avoid tightly specifying the number of microtasks in zero-chunk or immediately-errored cases.
web-platform-tests/wpt#12296 demonstrates one kind of timing sensitivity we have. Adding a Promise.resolve() to permit the promise returned by start() to settle changes the rejection returned by pipeTo(). I'm pretty sure that this behaviour is mandated by the standard.
I think probably implementations should be permitted to have either behavior in the "erroring" case.
Or maybe we want to force the initial check to always be asynchronous? That would make all currently compliant implementations non-conformant, which is bad. Also it's mildly inefficient.
Optionally, wait an additional user-agent determined amount of time. NOTE: this is intended to help avoid tightly specifying the number of microtasks in zero-chunk or immediately-errored cases.
I don't want to let them wait an arbitrary time. If it sometimes took 3 seconds for pipeTo() to do anything that would be very hard to work with. I want to say something like "Optionally, execute some pending tasks"
Hmm. Still having trouble deciding on the best approach here. Maybe it's simplest to just say that you're not allowed to wait, and nail things down that way? I.e. only wait if any writes have actually happened.
https://streams.spec.whatwg.org/commit-snapshots/51227372cc84846bdcf68312724c4cac6a4b9e58/#rs-pipeTo-shutdown-with-action
I think it's ambiguous whether this waits when no chunks have been read or not. This is visible because the behaviour of a pipeTo() that starts when one or both sides is closed or errored is tightly specified, and because waiting is detectable via microtask execution.
The text was updated successfully, but these errors were encountered: