Continuously reads lines from a StreamReader using a background thread while providing them to a foreground thread on demand.
More...
|
| StreamConsumer (StreamReader reader) |
| Starts reading from the stream in a background thread. More...
|
|
string? | ReadLine () |
| Returns the next pending line; null if there are no pending lines. More...
|
|
void | WaitForEnd () |
| Waits for StreamReader.EndOfStream. More...
|
|
override string | ToString () |
| Returns all buffered lines that have not been read yet. More...
|
|
Continuously reads lines from a StreamReader using a background thread while providing them to a foreground thread on demand.
Useful for processing Process.StandardOutput and Process.StandardError without risking deadlocks.
◆ StreamConsumer()
NanoByte.Common.Streams.StreamConsumer.StreamConsumer |
( |
StreamReader |
reader | ) |
|
|
inline |
Starts reading from the stream in a background thread.
- Parameters
-
reader | The stream to read from. |
◆ ReadLine()
string? NanoByte.Common.Streams.StreamConsumer.ReadLine |
( |
| ) |
|
|
inline |
Returns the next pending line; null
if there are no pending lines.
◆ ToString()
override string NanoByte.Common.Streams.StreamConsumer.ToString |
( |
| ) |
|
|
inline |
Returns all buffered lines that have not been read yet.
◆ WaitForEnd()
void NanoByte.Common.Streams.StreamConsumer.WaitForEnd |
( |
| ) |
|
Waits for StreamReader.EndOfStream.
The documentation for this class was generated from the following file:
- Common/Streams/StreamConsumer.cs