rejeep / prodigy.el

Manage external services from within Emacs
GNU General Public License v3.0
550 stars 39 forks source link

Issue #14: Service dependency feature #95

Closed FrancisMurillo closed 2 years ago

FrancisMurillo commented 7 years ago

Inspired by @shosti pull request for #14

This starts and stops services dependencies based on the issue behavior. In particular, the root of the dependency chain starts the whole chain while the leaf of the chain stops the chain. This feature also executes services based on their target status.

In particular, services are marked an entry in prodigy-dependency-services that checks if :conditions, a list of predicates to allow for wider behavior and state management, is satisfied which trigger the specified action based on :action. A pseudo-scheduler that checks its entries after each action.

Some possible issues:

Feedback is appreciated (and much rework)

rejeep commented 7 years ago

Firstly, thanks for working on this, it's a great feature!

image

This is a big change. For anyone to be able to understand anything of it, it must be broken down into smaller pieces. I haven't read the code in detail because it's too much to grasp. Would it be possible to implement this feature in for example three, four or five steps? All steps should be fully working and possibly even a release.

I would also like you to extend the description. What are the different parts that are needed, what are the possible issues, how does it affect the API, etc...

Hope this makes sense.

FrancisMurillo commented 7 years ago

Indeed, this is what I fear this feature is. Initially, my idea was to advice prodigy-start-service, prodigy-stop-service and prodigy-set-status to make the feature modular. In reference to the steps, do you mean I should create a base case commit, then build the others around it? The test in prodigy-dependencies-test.el is how I see the use cases and possible issues.

Since this is started as an advice, the base three functions are affected while majority of the API remains the same. The key aspect is that services that are or is in :depends-on have a managed start and stop. The key issue I have is managing the scheduler state when services are started, stopped or failed. If managed or cleaned improper, service may wait forever which is critical to address.

How about giving me specific steps to fulfill this feature? I'll do my best to fulfill each.

DamienCassou commented 2 years ago

I'm closing all old PRs. If you still care, please rebase your branch and reopen the PR.