Skip to content

Commit ce2147d

Browse files
rottycarllerche
authored andcommitted
Add a warning regarding the use of Stdin handles (tokio-rs#876)
Also see the discussion on issue tokio-rs#589.
1 parent fca41d4 commit ce2147d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tokio-fs/src/stdin.rs

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ use std::io::{self, Read, Stdin as StdStdin};
77
/// The handle implements the [`AsyncRead`] trait, but beware that concurrent
88
/// reads of `Stdin` must be executed with care.
99
///
10+
/// As an additional caveat, reading from the handle may block the calling
11+
/// future indefinitely, if there is not enough data available. This makes this
12+
/// handle unsuitable for use in any circumstance where immediate reaction to
13+
/// available data is required, e.g. interactive use or when implementing a
14+
/// subprocess driven by requests on the standard input.
15+
///
1016
/// Created by the [`stdin`] function.
1117
///
1218
/// [`stdin`]: fn.stdin.html

0 commit comments

Comments
 (0)