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

Introduce ThreadPoolExecutor without a Queue #853

Merged

Conversation

@fzakaria
Copy link
Collaborator

@fzakaria fzakaria commented Feb 14, 2020

This adds the ability for a ThreadPoolExecutor to have a queue
depth of 0.

This is useful if you'd like to perform the rejection handler if no
available threads are availabile.

This is analogous to Java's use of SynchronousQueue in
ThreadPoolExecutor.

See https://stackoverflow.com/a/10186825/143733 for more details

@fzakaria fzakaria requested review from pitr-ch and headius Feb 14, 2020
@pitr-ch
Copy link
Member

@pitr-ch pitr-ch commented Feb 16, 2020

I had a brief look, NICE! Good idea how to get around the problem with 0 already having a meaning.

@fzakaria
Copy link
Collaborator Author

@fzakaria fzakaria commented Feb 16, 2020

Thanks. Look forward to your feedback.

@fzakaria
Copy link
Collaborator Author

@fzakaria fzakaria commented Feb 27, 2020

@pitr-ch any update on this ?
I'd love to upgrade to this.

Copy link
Member

@pitr-ch pitr-ch left a comment

Thanks a lot! Looks good. Please apply the two suggestions and add a line into a Changelog.

fzakaria and others added 4 commits Feb 14, 2020
This adds the ability for a ThreadPoolExecutor to have a queue
depth of 0.

This is useful if you'd like to perform the rejection handler if no
available threads are availabile.

This is analogous to Java's use of SynchronousQueue in
ThreadPoolExecutor.

See https://stackoverflow.com/a/10186825/143733 for more details
@pitr-ch pitr-ch force-pushed the fzakaria:faridzakaria/bounded_queue branch from 754b4c4 to 7fa7e82 Mar 1, 2020
@pitr-ch
Copy link
Member

@pitr-ch pitr-ch commented Mar 1, 2020

I've checked and fixed documentation. I had to rebase on master.

fzakaria and others added 3 commits Mar 2, 2020
Co-Authored-By: Chalupa Petr <git@pitr.ch>
Co-Authored-By: Chalupa Petr <git@pitr.ch>
@fzakaria
Copy link
Collaborator Author

@fzakaria fzakaria commented Mar 2, 2020

Thanks @pitr-ch
I added CHANGELOG.md description.

@pitr-ch
pitr-ch approved these changes Mar 4, 2020
Copy link
Member

@pitr-ch pitr-ch left a comment

Thanks for the great contribution!

@pitr-ch pitr-ch merged commit 2c0755b into ruby-concurrency:master Mar 4, 2020
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.