overmind icon indicating copy to clipboard operation
overmind copied to clipboard

Allow process to wait for others

Open manuelpuyol opened this issue 5 years ago • 3 comments

It would be nice to have an option of a process waiting for another one to finish for them to start, or maybe a before could be enough. The use case behind this is that I want to install dependencies before running rails/webpack, I could have something like:

before: bundle install && yarn install && rake db:migrate
web: rails s
assets: yarn run
...

This could work like tmuxinator's on_project_start

manuelpuyol avatar Feb 13 '20 15:02 manuelpuyol

Interesting idea. Maybe your problem can already be solved with a simple sleep 1 ?

main_process: bundle exec ... dependent_process: sleep 1; bundle exec ...

tillcarlos avatar Apr 22 '20 17:04 tillcarlos

I don't think using sleepis a good idea, since the before command can have an unspecified running time (like installing gems/npm packages)

manuelpuyol avatar Aug 18 '20 20:08 manuelpuyol

I like the idea and would use such a feature. In the meantime, I solved my similar problem doing something like -- to reuse your example:

web: bundle install && rake db:migrate && rails s
assets: yarn install && yarn run

It's even slightly better, since bundle install does not block yarn install and they can run in parallel. What they depend on is then on their right and only executed afterwards.

Adeynack avatar Mar 31 '22 08:03 Adeynack