parallel
parallel copied to clipboard
Forwarding User Interaction and Feedback in CLI app
Hi there! It's not an issue but rather a question.
I'm working on a CLI app that runs several tasks, and a few of them require user interaction (using Symfony IO or Laravel Prompt) during execution. How can I forward the input from the child process to the main stdout and receive feedback in the child processes? Thanks
Hi @jenky!
ProcessContext
has getStdin()
and getStdout()
methods to return writable and readable streams, respectively, which may be used to read from STDOUT and write to STDIN of the child from within the parent process. In the parent, you can write the data read from the child STDOUT to STDOUT of the parent and take data received on STDIN of the parent and write it to STDIN of the child.
@jenky i have a question regarding your CLI app, i am facing a zombie problem. Files in /tmp/.sock files are left after each run. In web mode the .socket files are destructed correctly, but the same code in CLI mode does not destruct the .socket. Can you please confirm that on your side everything is working ( .sock destruction OK), if So, can you share your versions used for AMP and parallel. Thank you