DarthSim / overmind

Process manager for Procfile-based applications and tmux
MIT License
2.84k stars 79 forks source link

Allow process to wait for others #70

Open manuelpuyol opened 4 years ago

manuelpuyol commented 4 years ago

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

tillcarlos commented 4 years ago

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

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

manuelpuyol commented 4 years ago

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

Adeynack commented 2 years ago

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.