Closed
Description
Hi guys,
I'm starting to hack around with this gem and I'm having an issue with streaming the output of a command.
I'd have thought the block passed to the exec
command would be called each time some output is available.
Here's the command I'm using :
container.exec(['/bin/bash', '-c', 'ls && sleep 2 && ls && sleep 2 && ls'], chunk_size: 1) { |stream, chunk| puts chunk.size; $stdout.flush }
The block is effectively called 3 times, outputting the following :
85
85
85
That's great, however it seems that all blocks are executed when the command stops, and not every second for 3 second as I would have liked :
85
* 1 second sleep*
85
* 1 second sleep*
85
Is this normal behavior ? Is there a gotcha I missed ?
Thanks
Metadata
Metadata
Assignees
Labels
No labels