|
|
@ -1,6 +1,6 @@
|
|
|
|
# Terminal Synchroniser
|
|
|
|
# Terminal Synchroniser
|
|
|
|
|
|
|
|
|
|
|
|
Termsync is a **.NET Core** library for synchronising terminal IO in an asynchronous contex.
|
|
|
|
`termsync` is a **.NET Core** library for synchronising terminal IO in an asynchronous contex.
|
|
|
|
It guarantees user keystrokes into the console are never split up by `WriteLines()`s happening on other threads.
|
|
|
|
It guarantees user keystrokes into the console are never split up by `WriteLines()`s happening on other threads.
|
|
|
|
Also exposed is a global `Channel<string>` object for reading user input lines asynchronously.
|
|
|
|
Also exposed is a global `Channel<string>` object for reading user input lines asynchronously.
|
|
|
|
|
|
|
|
|
|
|
@ -28,7 +28,7 @@ Start the worker that reads and writes to `Console`.
|
|
|
|
### Write lines
|
|
|
|
### Write lines
|
|
|
|
Line writes are asynchronous, await them to yield until the line has been displayed in the `Console`.
|
|
|
|
Line writes are asynchronous, await them to yield until the line has been displayed in the `Console`.
|
|
|
|
``` c#
|
|
|
|
``` c#
|
|
|
|
await Terminal.WriteLine("A line.")
|
|
|
|
await Terminal.WriteLine("A line.");
|
|
|
|
```
|
|
|
|
```
|
|
|
|
### Read lines
|
|
|
|
### Read lines
|
|
|
|
Line reads can take `CancellationToken`.
|
|
|
|
Line reads can take `CancellationToken`.
|
|
|
|