Skip to content

feat: add a new API ReleaseTimeout for the default pool - #285

Merged
panjf2000 merged 1 commit into
panjf2000:devfrom
ELchem:dev
Jul 1, 2023
Merged

panjf2000 merged 1 commit into
panjf2000:devfrom
ELchem:dev

Conversation

@ELchem

@ELchem ELchem commented Jul 1, 2023

Copy link
Copy Markdown
Contributor

name: 'Unblock goPurge and goTicktock in defaultAntsPool'
about: ants.Release() calls defaultAntsPool.Release() which leaves goPurge and goTicktock still running in the background. ants.Release() should close the context for goPurge and goTicktock. This can be accomplished by calling defaultAntsPool.ReleaseTimeout().
title: ''
labels: ''
assignees: ''

1. Are you opening this pull request for bug-fixs, optimizations or new feature?

new feature

2. Please describe how these code changes achieve your intention.

goPurge and goTicktock are left on the stack because there is no way to close those methods started by the defaultAntsPool. This PR should add a fix for that.

3. Please link to the relevant issues (if any).

#244

4. Which documentation changes (if any) need to be made/updated because of this PR?

4. Checklist

  • I have squashed all insignificant commits.
  • I have commented my code for explaining package types, values, functions, and non-obvious lines.
  • I have written unit tests and verified that all tests passes (if needed).
  • I have documented feature info on the README (only when this PR is adding a new feature).
  • (optional) I am willing to help maintain this change if there are issues with it later.

…on defaultAntsPool and add associated unit test
@codecov

codecov Bot commented Jul 1, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (7be597c) 92.44% compared to head (d2d5227) 92.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #285      +/-   ##
==========================================
+ Coverage   92.44%   92.46%   +0.01%     
==========================================
  Files           9        9              
  Lines         768      770       +2     
==========================================
+ Hits          710      712       +2     
  Misses         44       44              
  Partials       14       14              
Flag Coverage Δ
unittests 92.46% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ants.go 86.36% <100.00%> (+1.36%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@panjf2000 panjf2000 changed the title add ReleaseTimeout function to ants.go to call ReleaseTimeout method … feat: add a new API ReleaseTimeout for the default pool Jul 1, 2023
@panjf2000 panjf2000 changed the title feat: add a new API ReleaseTimeout for the default pool feat: add a new API ReleaseTimeout for the default pool Jul 1, 2023

@panjf2000 panjf2000 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks~

@panjf2000 panjf2000 self-assigned this Jul 1, 2023
@panjf2000 panjf2000 added enhancement New feature or request pending merged This PR has been reviewed and approved accepted new feature proposal Proposal for this repo labels Jul 1, 2023
@panjf2000
panjf2000 merged commit a66958c into panjf2000:dev Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted enhancement New feature or request new feature pending merged This PR has been reviewed and approved proposal Proposal for this repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址