Skip to content

Conversation

@metcoder95
Copy link
Member

@metcoder95 metcoder95 commented Aug 5, 2025

Closes #868

@metcoder95
Copy link
Member Author

metcoder95 commented Aug 5, 2025

const ee = new EventEmitter();
const task1 = pool.run(bufs[0]);
const abortable = pool.run(bufs[1], { signal: ee });
assert.strictEqual(pool.queueSize, 0); // Means it's running
Copy link

@jdmarshall jdmarshall Aug 5, 2025

Choose a reason for hiding this comment

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

I have a PR against p-limit to reduce the nextTick depth by one and the confirmation that something was off was found in the tests, which were asserting similarly weird numbers for queue length. I just inverted a counter and queue manipulation to eliminate the nextTick call. Ans then had to fix the tests similarly.

@metcoder95 metcoder95 merged commit d081228 into current Sep 8, 2025
13 of 14 checks passed
@metcoder95 metcoder95 deleted the fix-emit-drain branch September 8, 2025 06:44
@ehsanghorbani190
Copy link

@metcoder95 Hi again! glad to see this PR is merged! i checked the npm and yet the last publish was two months, is this PR published or just merged?

@metcoder95
Copy link
Member Author

Haven't prepared yet the cut-off for the new v6; sadly this is a breaking change so cannot land on current stable :(

Unless done through an flag, which can be an option.

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.

needsDrain is emitted too late

4 participants