metaist / ds

run dev scripts
https://metaist.github.io/ds/
MIT License
4 stars 0 forks source link

Concurrent task execution #92

Open ixxie opened 20 hours ago

ixxie commented 20 hours ago

Is it possible to execute multiple long-running tasks concurrently, feeding stdout and stderr into the main process?

Our usecase is running a variety of services in dev mode in tandem, during development. We currently use concurrently.js for this, a NodeJS based tool. The challenge with this tool is that it doesn't play well with Uvicorn's HMR functionality.

I realize this is a big ask, so I wouldn't be surprised if you decide to scope this out of the library, but it is a very important usecase for workspace task running in my opinion.

metaist commented 17 hours ago

Thanks for writing out your use case; indeed that's a big ask and when I thought about it before, I kept it out of scope because I didn't have a compelling enough need, but I'm willing to think this through.

Syntactically, we'd add a --parallel to the CLI and composite.parallel to the config. We'd also label lines with the task name that started them + color (or something like that).

But the actual mechanism requires us to know: