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

How to handle dependencies between units? #6

Open
andymass opened this issue May 3, 2023 · 1 comment
Open

How to handle dependencies between units? #6

andymass opened this issue May 3, 2023 · 1 comment

Comments

@andymass
Copy link

andymass commented May 3, 2023

Currently all units are spawned in parallel at the same time. Sometimes, we might require a unit to be started before another. Can there be a way to specify Before= After=? Open question: how does a unit signal it has "started?"

@drubinstein
Copy link
Owner

It's an interesting idea. What use cases do you have in mind for dependencies between units? docker-compose used to have a depends_on key, but eventually removed it. With a good enough use case (keeping in mind that python-compose is meant for services and not as a generic workflow engine), I see no issue with implementing something similar for python-compose.

As a hack, there's nothing stopping you from adding a heartbeat endpoint to your Python services and waiting for those to respond 200 in the services that depend on the services with the heartbeat.

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

No branches or pull requests

2 participants