-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Labels
Milestone
Description
Discussion at #617 (comment) #617 (comment) #620 (comment) and #628 (comment) mentioned the need for adding a finally() method to underlyingSink (and underlyingSource?) at some point in the future.
It sounds like the ideas for finally are
- called after
abort,close, (andcancelandflush?) etc, are called (after their returned promises fulfill?) - called with any uncaught errors thrown synchronously by any method, or thrown by strategySize, or thrown by the implementation when e.g. strategy.size() returns NaN
- also called with the rejection reason of any rejected promise that causes the stream to become errored
Proposed arguments were finally(why, reason), where why is e.g. the string 'close' or 'abort', but what about all the other causes for finally to be called? What would 'why' be for an invalid queueing strategy return value causing a RangeError?
Should it stay as two arguments like that, or one object analogous to an IteratorResult?
ForbesLindesay