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

Multiple Arguments Pool Function #257

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

Conversation

void-developer
Copy link

@void-developer void-developer commented Oct 17, 2022

… 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

  • 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.

… Invoke function without explicitly creating an array
[doc] Updated example in main.go and updated it on the documentation
@sra94
Copy link

sra94 commented Oct 17, 2022

Useful! 👍🏻

@andreaSilv
Copy link

Looks fine, great! 👍👍

@panjf2000
Copy link
Owner

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

@panjf2000 panjf2000 added the long-term It's going to be a long-term work label Oct 18, 2022
@void-developer
Copy link
Author

void-developer commented Oct 18, 2022

Makes sense, I'll wait longer for it to be included then 👯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
long-term It's going to be a long-term work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants