Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pool size & running #535

Merged
merged 11 commits into from
Feb 8, 2021
Merged

feat: Pool size & running #535

merged 11 commits into from
Feb 8, 2021

Conversation

ronag
Copy link
Member

@ronag ronag commented Feb 4, 2021

No description provided.

@ronag ronag marked this pull request as draft February 4, 2021 11:48
@ronag
Copy link
Member Author

ronag commented Feb 5, 2021

Tests needs fixing

@ronag
Copy link
Member Author

ronag commented Feb 5, 2021

@dnlup Feel free to sort out the tests here if you want. But I was referring to the failures on master.

@ronag ronag force-pushed the pool-size-pending branch from bae5955 to a7cf29a Compare February 7, 2021 10:40
@ronag ronag marked this pull request as ready for review February 7, 2021 10:40
@ronag ronag requested a review from mcollina February 7, 2021 10:40
@ronag ronag force-pushed the pool-size-pending branch from a7cf29a to 25856c3 Compare February 7, 2021 10:41
@codecov-io
Copy link

codecov-io commented Feb 7, 2021

Codecov Report

Merging #535 (35d4e4f) into master (9e0c549) will decrease coverage by 0.06%.
The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #535      +/-   ##
==========================================
- Coverage   99.63%   99.56%   -0.07%     
==========================================
  Files          16       16              
  Lines        1366     1385      +19     
==========================================
+ Hits         1361     1379      +18     
- Misses          5        6       +1     
Impacted Files Coverage Δ
lib/pool.js 99.25% <96.42%> (-0.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e0c549...35d4e4f. Read the comment docs.

@ronag
Copy link
Member Author

ronag commented Feb 7, 2021

@mcollina

lib/pool.js Outdated Show resolved Hide resolved
@ronag ronag requested a review from mcollina February 7, 2021 19:29
@ronag ronag force-pushed the pool-size-pending branch 2 times, most recently from 719cf03 to eed6638 Compare February 7, 2021 19:44
@ronag ronag force-pushed the pool-size-pending branch from f1f57a9 to 35d4e4f Compare February 7, 2021 22:50
if (pool[kNeedDrain] && !this.busy) {
pool[kNeedDrain] = false
pool.emit('drain')
}
Copy link
Member

Choose a reason for hiding this comment

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

why this if was removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand the question.

Copy link
Member

Choose a reason for hiding this comment

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

you removed the if (queue.isEmpty()) check. Why?

Copy link
Member Author

@ronag ronag Feb 8, 2021

Choose a reason for hiding this comment

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

I replaced it with !this.busy which contains the same check through this[kPending] > 0

Copy link
Member Author

Choose a reason for hiding this comment

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

the empty check is moved to just if (pool[kClosedResolve] && queue.isEmpty()) {

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag merged commit 767f105 into master Feb 8, 2021
@ronag ronag deleted the pool-size-pending branch February 8, 2021 09:18
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.

3 participants