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

Allow for parallel "for" loops #1300

Closed
q0rban opened this issue Aug 9, 2023 · 1 comment
Closed

Allow for parallel "for" loops #1300

q0rban opened this issue Aug 9, 2023 · 1 comment
Labels
state: duplicate Duplicates another issue.

Comments

@q0rban
Copy link
Contributor

q0rban commented Aug 9, 2023

Currently dependencies run in parallel. With the introduction of looping over variables, it would also be nice to optionally have those jobs run in parallel.

If you agree, perhaps this syntax would be most intuitive (parallel: true inside the for object):

version: 3

tasks:
  default:
    vars:
      ITEMS:
        sh: echo {1..50}
    cmds:
      - for: { var: ITEMS, parallel: true }
        task: process-item
        vars:
          ITEM: '{{.ITEM}}'

  process-item:
    cmds:
      - sleep 5 
      - echo {{.ITEM}}
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Aug 9, 2023
@andreynering
Copy link
Member

I'll mark this as a duplicate of #1299.

Since dependencies run in parallel, both would have the same effect. Also, it's better to keep the discussion on a single place.

@andreynering andreynering added state: duplicate Duplicates another issue. and removed state: needs triage Waiting to be triaged by a maintainer. labels Aug 9, 2023
@andreynering andreynering closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: duplicate Duplicates another issue.
Projects
None yet
Development

No branches or pull requests

3 participants