-
Notifications
You must be signed in to change notification settings - Fork 161
Description
I believe it might be wise to separate the description of a process to be executed and its state while running from the Action which executes it.
Currently all of this information is encapsulated in the ExecuteProcess action, and my proposal would be to replace that with an action called Execute that takes an Executable (not an action or launch description entity, just a new kind of class). The Executable would contain any information needed by Execute to actually execute the executable described or introspect it. There could be sub classes of both Execute and Executable. For instance, a sub class of Executable might be Node or LifecycleNode, and a sub class of Execute might be ExecuteRemotely (execute on a different machine).
The reasons for doing this include:
- using
Executables (or subclasses thereof) with other actions - cleaner abstractions
- i.e. the
ExecuteProcessclass is really big now and it would be nice to break into smaller parts
- i.e. the
- more readable
- e.g.
Execute(Executable(...))orExecute(Node(...))rather thanExecuteProcess(...)andNode(...)
- e.g.
The first reason is the most impactful, because it allows for a few use cases that aren't currently easy to implement:
- Collect or generate
Executableinstances and later decide whether to pass toExecute,ExecuteRemotely, orExecuteInDocker(just ideas) - Pass
ComponentNode(possibly a subclass ofExecutablewhich represents a node that can be loaded dynamically) to eitherExecute()orExecuteNodesInSharedProcess()(name needs work)- where the latter would take several
ComponentNodeinstances and run them all in a single process
- where the latter would take several
I still have some design questions in mind, like:
- should
Nodeinherit fromExecutable - should
Executablecontain process related things likepidand produce events for stdout and process exit, etc...- or should there be a
Processthat also inherits fromExecutable - because
Nodemight not be associated with a process, or rather a process might not be associated with a singleNode
- or should there be a
- what is the contract between
ExecutableandExecute?- which creates event handlers and stores information?
- what exactly are the responsibilities of
Execute?