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

Feature: provide a way to shutdown the thread pool #97

Open
mattgathu opened this issue Sep 30, 2018 · 3 comments
Open

Feature: provide a way to shutdown the thread pool #97

mattgathu opened this issue Sep 30, 2018 · 3 comments
Labels
2.0 Currently planed for 2.0
Projects

Comments

@mattgathu
Copy link

It would be great to provide a mechanism to terminate all pending tasks and wait for the current one to complete.

Essentially complete the current executing jobs (since I'm not sure it's possible to terminate spawned threads). And then don't proceed doing any more work.

At the moment this is not possible.

@dns2utf8
Copy link
Member

Hi Matt

I think this feature would be great. What behaviour would you expect?
That after the stop_queue()/abort_pool() the queue is drained in the sense that all jobs up to this point are removed/ignored and new jobs are executed?
Or that the whole pool gets stopped forever?

I will think a bit more about it as well.

Cheers,
Stefan

@mattgathu
Copy link
Author

Or that the whole pool gets stopped forever?

This is my expected behaviour

My use case, for example, is an application that might get quit signals for the OS e.g. the Ctrl-C keyboard interrupt. Once I get this signal, I would like to gracefully shutdown the thread pool.

@dns2utf8 dns2utf8 added this to To do in 2.0 via automation Dec 18, 2019
@dns2utf8
Copy link
Member

With the design of 2.0 you will be able to shutdown generations of tasks.
So without knowing anything about the function running in the pool as soon as it is finished it will run out allowing for a proper shutdown of the pool.

@dns2utf8 dns2utf8 added the 2.0 Currently planed for 2.0 label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 Currently planed for 2.0
Projects
2.0
  
To do
Development

No branches or pull requests

2 participants