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
Contributor

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 February 14, 2020 20:39
@pitr-ch
Copy link
Member

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
Contributor Author

Thanks. Look forward to your feedback.

@fzakaria
Copy link
Contributor Author

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

Copy link
Member

@pitr-ch pitr-ch left a comment

Choose a reason for hiding this comment

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

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

fzakaria and others added 4 commits March 1, 2020 10:32
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 faridzakaria/bounded_queue branch from 754b4c4 to 7fa7e82 Compare March 1, 2020 09:40
@pitr-ch
Copy link
Member

pitr-ch commented Mar 1, 2020

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

@fzakaria
Copy link
Contributor Author

fzakaria commented Mar 2, 2020

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

Copy link
Member

@pitr-ch pitr-ch left a comment

Choose a reason for hiding this comment

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

Thanks for the great contribution!

@pitr-ch pitr-ch merged commit 2c0755b into ruby-concurrency:master Mar 4, 2020
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