Skip to content

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

@kaka1909

Description

@kaka1909

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions