-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Bounbed task queues #91
Comments
Hey @korotin! pool := pond.NewPool(10, pond.WithCapacity(1000)) Any thoughts on this? I'm still wondering what would be the best name for this option. |
Hey @alitto ! It's good to know that we're on the same page here. I vote for On the other hand since you've called your new task queues unbounded, maybe play around that? I mean something like |
Cool, |
I completely agree with most of what you said, but I'm not 100% sure about the non-blocking scenario. Here's my concerns:
At the same time I do understand that cases when you don't want to wait if tasks cannot be added are completely legitimate and I don't see any other ways (at least good ones) to implement the non-blocking behavior. |
You have a great point, adding all those blockingBoundedPool := pond.NewPool(10, pond.WithQueueSize(10)) And to create a non-blocking bounded pool: nonBlockingBoundedPool := pond.NewPool(10, pond.WithQueueSize(10), pond.NonBlocking) What do you think? |
Actually I came up with exactly the same idea yesterday but wasn't sure if it's good enough :) My main concern here is that such option would change global behavior which is non-granular and may be unexpected. What do you think about expanding definitions of pool.Submit(func() { }, pond.NonBlocking) With such expansion we would keep granularity and obviousness of |
I really like the idea of having options on |
Well, we may have |
V2's task queues are unbounded by default, but in some cases it may be useful to have them bounded. As far as i can see there's no option to do that right now.
Was that decision intentional? I mean are there any design limitations or conceptual thoughts that make such option unwanted or even impossible?
The text was updated successfully, but these errors were encountered: