Skip to content

Audit/improve "don't block the event loop" and "next.tick event loop and timers" guides #4404

Closed

Description

@benjamingr

Hey,

We currently have two guides talking about how Node.js events work. It's really important to have these guides explaining the event loop and how node runs - they both would benefit from a big update for example the event loop guide starts with:

The event loop is what allows Node.js to perform non-blocking I/O operations — despite the fact that JavaScript is single-threaded — by offloading operations to the system kernel whenever possible.

JavaScript is not single threaded and it does not explain what non-blocking I/O does.


I think it's important to explain the user facing consequences of the timing of things in Node - for example from a user's point of view it is a lot more important to learn that microtasks (like nextTick/queueMicrotask and promises) get scheduled ahead of I/O all the time and it's possible to starve I/O with it.

Since these guides are so important it would be awesome if the foundation could even pay a technical writer to talk to some project people and review it.

Activity

  1. Trott commented on Feb 4, 2022

    @Trott
    Member

    Since these guides are so important it would be awesome if the foundation could even pay a technical writer to talk to some project people and review it.

    That would get the info updated and it might not be a bad way to go. But it will be a one-time event and the two guides will go back to not being maintained at all, like all of our guides.

    With the guides, I'm generally an advocate for a two step process:

    1. Find the essential Node.js-specific material in there (emphasis on essential and not merely Node.js-specific) and make sure that material is represented in the appropriate places in our API docs.
    2. Find reliable external sources that provide the other information and replace the guides with links to those sources.

    We've done this in https://nodejs.org/en/knowledge/javascript-conventions/what-is-the-arguments-object/ and I'd love to see it elsewhere.

  2. benjamingr commented on Feb 4, 2022

    @benjamingr
    MemberAuthor

    Find reliable external sources that provide the other information and replace the guides with links to those sources.

    @goldbergyoni is that something you'd be interested in maintaining (for these guides)?

  3. samaianikasi1228 commented on May 20, 2022

    @samaianikasi1228
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