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

Why not support non-empty arguments function with Concurrent or Parallel? #2

Open
woofyzhao opened this issue Apr 5, 2019 · 5 comments

Comments

@woofyzhao
Copy link

No description provided.

@rafaeldias
Copy link
Owner

Are you receiving any error while using non-empty arguments function with Concurrent or Parallel? Can you show us any example of what you are trying to do?

@hawkinggg
Copy link

Are you receiving any error while using non-empty arguments function with Concurrent or Parallel? Can you show us any example of what you are trying to do?

Hi, it seems that concurrent/parallel API don't support pass parameters

func execRoutine(f reflect.Value, c chan execResult, key string) {
var (
exr = execResult{} // Result
res = f.Call(emptyArgs) // Calls the function
)

Routine call function with emptyArgs in func.go

@rafaeldias
Copy link
Owner

rafaeldias commented Nov 28, 2019

@hawkinggg I see. When writing those functions three years ago I thought of Parallel and Concurrent functions receiving an optional list of parameters as last argument that would be passed to every function passed to them, but at the time I had no use for this case.

Maybe a modification like:

async.Concurrent(async.Tasks{
        func(i int, s string, b bool) error { ... },
        func(i int, s string, b bool) error { ... },
        func(i int, s string, b bool) error { ... },
}, 1, "test", false)

Could solve the problem without breaking the current usage of the package.

@MrNocTV
Copy link

MrNocTV commented Mar 10, 2023

@rafaeldias

Hi, 4 years later, I see that this library has a lot of potential. Can you make me as the contributor to this library?
I will resolve those 2 issues.

@SealOfTime
Copy link

@MrNocTV I believe, you may start with creating pull requests to resolve those issues without becoming a contributor, by just forking it and making a PR from your fork.
Additionally, if the maintainer of this library won't have time for the job, community we'll be able to continue to live with the fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants