Zazaeil
Zazaeil

Reputation: 4119

Parent process <- child processes UNIdirectional communication in "real-world" Haskell?

Goal:

  1. There is an IShell which is nothing but an ordinary console able to consume somewhat command like do param1=value1 --option. IShell should orchestrate whole execution. It does not run commands, the only thing it does is starts appropriate process.

  2. Any process started from the running IShell instance should be able to report back to it what's happening inside. So, say, IShell has started process A to do something complicated; process A should be able to report both progress and result back to parent IShell. In practice, it means, that there should be a mechanism how to, for example, print message from process A to appropriate IShell.

  3. Finally, code should work both with Windows and Linux.

I really like Haskell and I'd like to promote "real-world" Haskell usage. But I don't know existing libraries well, I haven't done yet any "real-world" Haskell app.

Thus, questions:

How can I establish IShell <- it's processes communication? Is there a single library able to handle both Windows-specific and Linux-specific stuff?

Upvotes: 0

Views: 49

Answers (1)

Daniel Wagner
Daniel Wagner

Reputation: 152867

The process package supports Linux and Windows and provides mechanisms for communicating with children processes via their stdin, stdout, stderr, and exit code.

The network package supports Linux and Windows and provides mechanisms for communicating with children processes via socket.

Upvotes: 1

Related Questions