Open rejeep opened 10 years ago
Why not just use :name instead of a new :id attribute?
Well, the reason I had in mind was that name is something that might change from time to time, while an id would not. I want to be able to change the name without updating a lot of other services. Just an idea. That's why I created this issue to create some discussion. :)
I have a feeling you'll get a lot of services with equal :name and :id. And if the name changes, wouldn't the id likely be outdated too?
You guys are probably right, updating the issue.
Id's are however better for people naming their services like this. But that's not something I recommend :)
Would it be useful to have the ability for one process to wait until another is in a ready state?
Good thinking. For example, Rails won't start without a database. Would make things a bit more complex though.
For me, I wanted to treat several services as one master service or set. Starting and stopping together instead of doing it individually. Not dependencies per se but a guarantee that several services work together instead.
I made an external module prodigy-set.el to do so. I thought about hacking with prodigy to get it done but there are concerns that might leak such as extra libraries (probably deferred.el
but abstaining), overlapping or circular sets, action locking and others so I thought an external mode might offer better safety.
My use case is with using a tor
proxy with w3m
. In order to join them, it needs a middleman proxy such as polipo
and privoxy
or both. I setup each proxy as a service but I want them to start in order when each is ready; likewise when one is down, I want them all down. The screencast shows my intention.
I do hope there is an official dependency management working to make things easier.
The downside with groups is that some service might have to be started for another to be able to start. I think the elegancy with dependencies is that both issues are solved with it.
I've been looking at this and it seems like the current tags feature is close to it but doesn't quite do the thing we want. :needs '(x y z)
would be enough to say 'ensure all of these are started before starting the current one'.
It's what docker-compose and CI pipelines do without overthinking it.
Some of my services require other services in order to fully work. I suggest adding the property
:depends-on
. For example:Starting service "Playground" would also start service "Script". It should not stop or restart dependencies since other services might rely on it.