Sitelet https://github.com/nodejs/node/issues/33528
Skip to content

馃殌 AbortController in Node task list聽#33528

Description

@benjamingr

Hey,

James started a PR at #33527 and we're having a summit meeting in openjs-foundation/summit#273 regarding adding AbortController to core.

Other than checking out the code and testing it (please do) James listed some work items in that PR when I asked and I figured it would be nice to have a list of them here.

This list is mutable. While our process is typically that collaborators don't edit each other's posts - you are welcome to add/remove/edit this list (please do!) as you see fit:

  • Core APIs:
  • Figure out how util.promisify should support cancellation, and if it does what that API should look like.
  • Figure out how to have good/debuggable AbortErrors when things go wrong.

Activity

  1. benjamingr commented on May 23, 2020

    @benjamingr
    MemberAuthor

    Starting to work on an Initial list of core APIs that can utilize AbortController. Please feel free to edit this everyone.

  2. benjamingr commented on May 23, 2020

    @benjamingr
    MemberAuthor

    @jasnell hey just to understand, are you interested in only supporting the promise (or promisifed) versions of the APIs (at least initially) or would you like to also explore adding it to the callback versions?

    (Inb4: doing one or the other does not preclude us from doing one or the other in the future)

  3. jasnell commented on May 23, 2020

    @jasnell
    Member

    Supporting on callback versions is certainly possible and would likely help make things more consistent.

  4. Bnaya commented on May 23, 2020

    @Bnaya

    We need to also think about abort detection,
    In the browser fetch there's very vague AbortError which is DOMException with name="AbortError",
    And the protocol is kinda error instanceof Error && error.name === "AbortError"
    There is no direct constructor for that error
    Minimal code to get it:

    c = new AbortController()
    p = fetch('', {signal: c.signal}).catch(e => e)
    c.abort()
    abortError = await p;
    console.log(abortError, abortError.name, abortError.message)
    
  5. benjamingr commented on May 23, 2020

    @benjamingr
    MemberAuthor

    @Bnaya thanks, I added it to the list, feel free to spin up a document and bikeshed there - it's not like it's half of what we do together in our 9-5 anyway :D

  6. benjamingr commented on May 23, 2020

    @benjamingr
    MemberAuthor

    @ptomato would either of you be interested in taking the API bikeshedding part?

    I went over some APIs? (I'm trying to figure for what APIs it makes sense but probably not how it would look like). Error are also interesting to discuss

  7. ptomato commented on May 25, 2020

    @ptomato

    @ptomato would either of you be interested in taking the API bikeshedding part?

    Yes, definitely. I had actually already started on that for myself. There is some proof of concept in https://github.com/ptomato/node/commits/31971-abortcontroller . I don't have much time to work on it this week, but next week I can continue.

  8. benjamingr commented on Dec 7, 2020

    @benjamingr
    MemberAuthor

    This has been superseded and stalled so I'm closing. The usual "if anyone feels strongly - feel free to reopen" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions