To stream output in real time, iterate over
process.stdout before you call .result(). If you only need the final output, skip the iteration and access it through result.stdout after you call .result().