I am using LispWorks's Multiprocessing tools (see here). I start a number of subprocesses (using process-run-function), where each subprocess is associated with a particular mailbox. What I want to achieve is that messages to standard output (using format) in the subprocess end up in the mailbox, after which I can read them in the main process.
I would go about this by replacing the *standard-output* stream of the subprocess with a custom stream that calls mailbox-send on the formatted string. However, I have no idea on how to create a custom stream like this. What are my options here?
Something like this:
Then you can use
READ-LINE,WRITE-LINE,READ-CHAR,WRITE-CHARon streams created like this: