Improve description of continous output processing (#380)

This commit is contained in:
Anatoli Babenia 2018-04-26 01:23:36 +03:00 committed by Andrew Gauger
parent 20cef5b8d4
commit c1f50576e5

View file

@ -558,13 +558,12 @@ fn run() -> Result<()> {
[![std-badge]][std] [![cat-os-badge]][cat-os]
Contrary to [Run an external command and process
stdout](#ex-parse-subprocess-output), while an external [`Command`] is
running, process its standard output without waiting it to finish. A
new pipe is created by [`Stdio::piped`] and it is read continuously by
a [`BufReader`].
In [Run an external command and process stdout](#ex-parse-subprocess-output),
processing doesn't start until external [`Command`] is finished.
The recipe below creates a new pipe by calling [`Stdio::piped`] and reads
`stdout` continuously as soon as the [`BufReader`] is updated.
The below recipe is equivalent to run the Unix shell command
The below recipe is equivalent to the Unix shell command
`journalctl | grep usb`.
```rust,no_run