New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catching STDERR output #66
Labels
Comments
You can use async(ByteStream\pipe(...), $process->getStdout(), ByteStream\getStdout())->ignore();
async(ByteStream\pipe(...), $process->getStderr(), ByteStream\getStderr())->ignore(); |
If you want both streamed to stdout, you can of course change the destination in the second call. |
Thanks a ton for the answer. One last question in this regard. In the given context, how do I Loop::run(function () use ($values, $command, $placeholder, $output, $progressBar, $workers, &$exitCode) {
yield ConcurrentIterator\each(
Iterator\fromIterable($values),
new LocalSemaphore($workers),
function ($value) use ($command, $placeholder, $output, $progressBar, &$exitCode) {
// TODO: Break the "each".
}
} Will it be a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure if y'all take support requests directly through the issue queue, so I'll try my luck. I created the tool Drall and one of it's main features is parallel processing, which is powered by
amphp/process
.Reference: context.
Question 1: Catch STDERR
Here, I only get the STDOUT contents from
$process
. How do I get bothSTDOUT
andSTDERR
, preferably, intermingled output, i.e. not in separate variables. Is appending2>&1
the only way? Or is there another way?Question 2: No buffer
Currently, I use
ByteStream\buffer($process->getStdout());
where I catch the output in a variable. Is there a way to let the output go toSTDOUT
directly instead of catching it in a variable?Any help will be appreciated.
The text was updated successfully, but these errors were encountered: