2026/08/31

From WoozleCodes
Jump to navigation Jump to search
Monday, August 31, 2026 (#243)
prev ⇐ Sunday Monday Tuesday

References

Main Work

I'm foolishly trying to improve some untidy stuff in the process-management parts of Ferreteria, because while I was fixing the DBA exporting readout I noticed it was opening a separate SSH connection for each schema.

I'm justifying this quixotic quest with the idea that the whole system is a little fragile -- because when I tried to change a process so it made more sense, it broke local exports but not ssh, which is something that also happened a few days ago when I made some changes to how Streams are handled.

Relevant pages:

  • 2026/04/04 is where I worked out the last major revision to some of this stuff, though I don't think I ever documented it properly.
  • clades:
  • important functions:
    • DoCommand(CommandIface &$oCmd): sets up the Command's Updater (if any); calls SendCommand() (but should it?)
    • SendCommand(): calls $this->OExecRespond->PushBytes(<command>)
    • StartProcess(): dependent on connection type:
      • Local calls proc_open(<command>, $arConf, $aPipes)
      • SSH2 calls ssh2_exec($rConn,<command>)
    • NewSession(CommandIface &$oCmd) (in Starter): creates a new Session object and passes it the Command object
    • Connectify() (Remote (i.e. SSH2) only): connects (using ssh2_connect() and ssh2_auth_agent(), eventually to be expanded to other auth methods)

In my head, it should work like this:

  • create connection object
  • open the connection
  • for each schema:
    • open a stream to receive responses
    • send the command
    • read the responses
    • close the stream
  • close the connection