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

how to safely submit work as pool might be closed earlier. #48

Open
kaka1909 opened this issue Mar 29, 2023 · 0 comments
Open

how to safely submit work as pool might be closed earlier. #48

kaka1909 opened this issue Mar 29, 2023 · 0 comments

Comments

@kaka1909
Copy link

kaka1909 commented Mar 29, 2023

Firstly, thanks for the great work to provide easy code to manage the pooling work.

Background
I am using the tunny with gin framework to do some heavy work triggered from user request, and too many heavy works might lead to cpu peak or memory issue in short time, I limit the tunny work count.

Concern
I hooked my tunny cleanup work with gin server shutdown, so if server is signaled to close, I get chance to close the pool. But I am afraid that if there is new job submitted after pool shutdown, the panic will happen. How to safely manage this?

Thanks.

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

No branches or pull requests

1 participant