2026/03/14

From Woozle Writes Code
< 2026 | 03
Jump to navigation Jump to search
Saturday, March 14, 2026 (#73)
Friday Saturday Sunday posts:prev <this> next

References

10:12

The problem turned out to be a subtle logic error in ItWent::Assimilate():

  • Only use the local $isOkay if $isTried is TRUE.
    • If it is, then [local $isOkay] &= [remote $isOkay]; otherwise, just copy [remote $isOkay].
  • Don't update the local $isTried from the remote before doing the above test.

There may be some logic to refine around combining the two $isTried values; for now, I just let the remote override the local.

14:42

Once again at the rockface: the current problem is figuring out how to properly handle a command that does not execute-and-end but which involves starting a process, communicating with the process, and then closing it again. This issue didn't come up with exports because, although there is communication before the exit, it is entirely (after the initial command) initiated by the process, which then ends when it is through sending. For imports, we need to be able to send a command and data and then tell the process when we're done.

Having written that, one obvious possible solution is to send the data with the command. That may be the "get it working now" option.

16:31

I think that could work in theory, but it also means I'd need some way of setting up a Stream that lets you prepend the command-text to the file-data -- so it's not a quick-&-obvious solution. It may be better to solve the larger problem.

17:00

Now taking a closer look at CmdLine to see if there's a clean/elegant way to integrate the idea of being able to leave the process running and then close it later (from the client side).

I don't want to ask this, because pinning down the answer seems difficult, but I probably should:

  • Q1: Why isn't the opening/shutting of a command part of Runner's Open()/Shut() functionality?
    • ℹ The DoWait() flag is a partial implementation of "leave it running", but I haven't actually used it successfully.
      • Exports set up the Streams/Canals and then let the Runner do the check-loop (DoWait(TRUE)).
      • Imports would need to set DoWait(FALSE) and the Runner would need to leave the command running, with some way for the Client to signal "I'm done".

19:03

Kluge idea: have another flag in CmdLine that means "end current process". So we'd call DoCommand() once with DoWait(FALSE), do the I/O loop, then call it again with DoShut(TRUE).

  • ...or maybe DoWait() should be renamed and accept a tri-state value ("start+finish", "start", and "finish")?