ants icon indicating copy to clipboard operation
ants copied to clipboard

Multiple Arguments Pool Function

Open void-developer opened this issue 2 years ago β€’ 4 comments

… Invoke function without explicitly creating an array


name: Pull request about: Propose changes to the code title: 'Multiple arguments pool func' labels: '' assignees: ''

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

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

To schedule a function with multiple arguments got a little bit ugly when creating an array to pass as an argument, then casting the interface{} to an array again and retrieving the single args. This slight change helps the developer to easily invoke its function passing multiple arguments and receiving directly the array of args. This of course means that single arg functions still have to parse the arg with arg[0]

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

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

Mainly just the code used as an example, the updated README is included with the PR

4. Checklist

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

void-developer avatar Oct 17 '22 17:10 void-developer

Useful! πŸ‘πŸ»

sra94 avatar Oct 17 '22 18:10 sra94

Looks fine, great! πŸ‘πŸ‘

andreaSilv avatar Oct 17 '22 18:10 andreaSilv

This is a breaking change, I think we shouldn't rush into it.

panjf2000 avatar Oct 18 '22 12:10 panjf2000

Makes sense, I'll wait longer for it to be included then πŸ‘―

void-developer avatar Oct 18 '22 13:10 void-developer