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

Parallel task execution #446

Open
lynaghk opened this issue Sep 4, 2022 · 2 comments
Open

Parallel task execution #446

lynaghk opened this issue Sep 4, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@lynaghk
Copy link

lynaghk commented Sep 4, 2022

Would you be open to a PR implementing parallel task execution?

My use case is developing a web app.
The backend and frontend are implemented in different languages with separate live-reloading infrastructure, so it makes sense to keep those in separate containers / dependency chains.

It'd be nice if a single command could run both tasks in parallel (in the example below, toast dev).
Currently one must open separate terminals and manually run two separate toast tasks.
This makes it harder to hand-off to teammates, since I can't give them a single command to start the dev environment.

One could write a little shell script to spawn two toast invocations, but then responsibilities are muddled ("I thought I was supposed to use toast to run commands, so why do we have some shell scripts?")

For my case, it'd be fine to interleave the output.
Alternatively we could also have an option to prefix each line of the output with the task name.

image: ubuntu:22.04@sha256:0f744430d9643a0ec647a4addcac14b1fbb11424be434165c15e2cc7269f70f8
command_prefix: set -euo pipefail
tasks:

  dev:
    description: Start the entire development system
    dependencies:
      - frontend
      - backend

  frontend:
    description: Start the frontend builder / live-reloader
    command: |
      while true; do
        echo 'frontend...'
        sleep 1
      done

  backend:
    description: Start the backend server
    command: |
      while true; do
        echo 'server...'
        sleep 1
      done
@lynaghk lynaghk added the enhancement New feature or request label Sep 4, 2022
@stepchowfun
Copy link
Owner

Hello, this is an interesting proposal, but it would be a significant change. See the discussion here: #405

I don't think I currently have the bandwidth to commit to reviewing a PR for this, but I welcome any discussion about it. It would be nice to have this someday!

(If you think this could be implemented fairly easily with a small-ish change, let me know—maybe I'm overestimating the work.)

@lynaghk
Copy link
Author

lynaghk commented Sep 7, 2022

Sure thing, thanks for the pointer to previous discussion. I'll take a look at impl details sometime to gauge complexity and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants