2026/01/21

From Woozle Writes Code
Jump to navigation Jump to search
Wednesday, January 21, 2026 (#21)
Tuesday Wednesday Thursday posts:prev <this> next

Fixing Execution Clades, pt.2

I started to rework the Stream and Process subsystems, but then realized why I had done things the way I did them, so reverted to tweaking the original clades -- which seem to be heading in the same direction that the reworking was going. The reworking should probably happen, but maybe after this is all working properly.

So now I'm wondering: should a Process be seen as a form of Stream, even though it also will need to contain Stream objects?

  • They both need methods for receiving and emitting data.
  • They both get opened and closed.

I'm going with "yes": Process is now a podling of Stream.

Also, the SSH wrapper should probably also be a type of process, since it runs things (remotely) and manages I/O to the things it runs. It's already also a type of Shell which is a type of Plug, and I'm not really understanding what I was doing with those clades when I originally wrote them (especially Plug).

  • ...or maybe it should be split into two pieces (one to handle Stream ops and the other to handle whatever it is Plug does) kind of like the way database Engine functionality is split into Conn and Oper?
    • Is Plug maybe basically just a connection manager? (Socket looks more like that, though, since it has a Host and Creds. ...and a Plug. What does Plug do.)
      • Looking at how Socket->OPlug() is generally used, it really does seem to be about the connection: opening and closing.
        • So, in the config, what happens if we dispense with any Plug objects and instead just use the thing the Plug is wrapping?
          • Well, it turns out we don't use the Plug class directly (we can't anyway: it's abstract); what we do use is Plug-podlings: Chain, Local, SSH. Do these need to descend from Plug? What if we changed them to descend from Stream instead?
            • So: we end up needing to PullBytes() and PushBytes() from a DB Conn object. Does this make any sense? I suppose it sort of does, though it would just be a pass-thru to some other object. Maybe a "Plug" is like a code-side endpoint? Or maybe Conn objects shouldn't be Streams (although they are Connections, since they must be opened and closed). Trying that (no problems so far).
            • ...and maybe a Process (be that Local or SSH) isn't a Stream, but has Streams... or does it make sense to have Processes implement PushBytes() / PullBytes()? They could access the default input/output streams...