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

add support for Run(ctx) interface #246

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

godcong
Copy link

@godcong godcong commented Aug 5, 2022


name: Pull request
about: Add support for Run(ctx) interface

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

yes
This is a pr for interface Run(ctx) support

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

NewPoolWithRunner has been added.
Can support submit any that implements the Runner interface

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

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

ants_test.go
pool_run.go
worker_run.go
run.go

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.

@panjf2000 panjf2000 added enhancement New feature or request proposal Proposal for this repo needs investigation This issue or proposal needs some investigations labels Aug 8, 2022
@panjf2000
Copy link
Owner

kind of busy these days, I will review this PR a few days later, thanks.

README.md Outdated
@@ -92,6 +92,16 @@ func demoFunc() {
fmt.Println("Hello World!")
}

type run struct {
i int32
wg *sync.WaitGroup

Choose a reason for hiding this comment

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

it needs to gofmt here.

Copy link
Author

Choose a reason for hiding this comment

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

@hawkingrei
Yes, found this formatting issue.
Since it's a markdown file, I fixed it manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs investigation This issue or proposal needs some investigations proposal Proposal for this repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants