Skip to content

define semantics of {source,sink}.finally() #636

Open
@isonmad

Description

@isonmad

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, (and cancel and flush?) 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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions