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

Submit a task with args to pool #158

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

Conversation

icecube092
Copy link

@icecube092 icecube092 commented May 27, 2021


name: Resolve problem with args capturing

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.

Sometimes, we need to call go-routines with args, but by default we have problem - wrong args capturing. And pool has the same problem. This PR resolves this problem.

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

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.

@panjf2000
Copy link
Owner

Why bother when we already have https://github.com/panjf2000/ants/blob/master/pool_func.go?

@panjf2000 panjf2000 added invalid This doesn't seem right waiting for response waiting for the response from commenter labels May 29, 2021
@icecube092
Copy link
Author

It's not the same, for example, i need to have one pool for service without redefining. And sometimes I need to submit task with arguments, which will be captured without this functional. Now, I use an own solution for this.
Your functional offers to create a new pool (for one time?).

@panjf2000
Copy link
Owner

Sorry, I don't get your point here, would you give me one case where the current API doesn't work and yours does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right waiting for response waiting for the response from commenter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants