Skip to content

doc: clarify async caveats for events.once()#61572

Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Renegade334:doc-events-once-async-caveats
Feb 12, 2026
Merged

doc: clarify async caveats for events.once()#61572
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Renegade334:doc-events-once-async-caveats

Conversation

@Renegade334
Copy link
Member

@Renegade334 Renegade334 commented Jan 28, 2026

The current warnings for events.once() focus heavily on process.nextTick().

The footgun really appears in any case where sequential await events.once(...) statements are used, as execution won't resume within the suspended async function until the current call stack has completed, by which point multiple events may have been emitted. This is just as likely to be run into in general execution, rather than with process.nextTick() specifically.

Refs: #34220

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. events Issues and PRs related to the events subsystem / EventEmitter. labels Jan 28, 2026
@Renegade334 Renegade334 requested a review from jasnell January 28, 2026 23:56
@Renegade334 Renegade334 added the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 12, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 12, 2026
@nodejs-github-bot nodejs-github-bot merged commit 3b69757 into nodejs:main Feb 12, 2026
28 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3b69757

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

Labels

doc Issues and PRs related to the documentations. events Issues and PRs related to the events subsystem / EventEmitter.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments