Skip to content

discuss: future of AsyncWrap #7565

Closed
Closed
@bnoordhuis

Description

@bnoordhuis

I've been taking a look at the AsyncWrap this week and I think it's time we discuss whether it has a future in core. Things that stand out:

  1. Besides a 1.5 year old NodeSource blog post it's undocumented.
  2. It is unclear to me whether there are any users.
  3. There is only minimal test coverage. For example, the functionality of the _asyncQueue property is untested. It's hard to determine whether AsyncWrap is really in a working state (also because of point 2); it's almost certainly broken for things like timers that don't have a 1-to-1 mapping to libuv handles.
  4. It results in a fair amount of complexity and duplication. For example, the node::MakeCallback() and node::AsyncWrap::MakeCallback() functions are just different enough that it's awkward to unify them, resulting in ~200 lines of duplicated code.

For the sake of keeping core maintainable, I would like people to comment on whether AsyncWrap is something that we should keep.

cc @nodejs/ctc, @trevnorris in particular, and @AndreasMadsen

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussIssues opened for discussions and feedbacks.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions