Skip to content

perf(index): use native stream consumer and events#599

Open
Fdawgs wants to merge 3 commits into
mainfrom
refactor/error-flag
Open

perf(index): use native stream consumer and events#599
Fdawgs wants to merge 3 commits into
mainfrom
refactor/error-flag

Conversation

@Fdawgs

@Fdawgs Fdawgs commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Cleaner than the errorHandled boolean and still rejects if an abort signal is passed.
Functionally the same.

Benchmarks show it to be ~2x faster.

Checklist

Copilot AI review requested due to automatic review settings July 4, 2026 20:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the UnRTF#convert child-process event handling in src/index.js by removing the errorHandled boolean and switching to once() event listeners for "error" and "close".

Changes:

  • Removed the errorHandled flag used to suppress "close" handling after an "error" event.
  • Replaced .on("error"/"close") handlers with .once("error"/"close") listeners.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.js Outdated
@Fdawgs Fdawgs closed this Jul 4, 2026
@Fdawgs
Fdawgs deleted the refactor/error-flag branch July 4, 2026 20:38
@Fdawgs
Fdawgs restored the refactor/error-flag branch July 5, 2026 13:02
@Fdawgs Fdawgs reopened this Jul 5, 2026
@Fdawgs
Fdawgs force-pushed the refactor/error-flag branch from ffe0c5f to b91010a Compare July 20, 2026 17:56
@Fdawgs Fdawgs changed the title refactor(index): replace errorHandled flag with once() listeners refactor(index): use native stream consumer and events Jul 20, 2026
@Fdawgs
Fdawgs requested a review from Copilot July 20, 2026 17:56
@Fdawgs
Fdawgs force-pushed the refactor/error-flag branch from b91010a to 5efe27b Compare July 20, 2026 17:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/index.js Outdated
Comment thread src/index.js Outdated
@Fdawgs Fdawgs changed the title refactor(index): use native stream consumer and events perf(index): use native stream consumer and events Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants