Ferreteria/v0.6/sys/Connx/run

From Woozle Writes Code
Jump to navigation Jump to search
Ferreteria: process-management subsystem

About

  • Purpose: We need to have an abstract model for running executables in different contexts (mainly: local vs. remote, where the latter mainly means "via ssh"), so that the control-code doesn't need to know anything about where the executable is.

Process Control Modeling

explanation model-implementation map

The ssh2 library and the local process library have significantly different approaches to managing processes.

  • In SSH2, you first open the session (ssh2_connect()) to get a session-resource, and then you send commands (ssh2_exec()) via that resource.
    • You can also open a shell (ssh2_shell()) for further commands, though it's unclear what the difference is.
  • In proc, a process starts with a command. The command can then be left running to receive additional data, which will be interpreted by the initial command.
Action: Proc Action: SSH2
Model Action Starter Session Starter Session
Open NO OP create Session object ssh2_connect()
Command proc_open() send to stdin forward to Session object ssh2_exec()
Shut NO OP zap Session object ssh2_​disconnect()

History