v1.6.2 Cancellable Read()
What's Changed
This update allows implementers to call Consoul.Read()
and include a CancellationToken
to cancel the read operation at anytime. For example:
using(var canceller = new CancellationTokenSource()) {
canceller.CancelAfter(TimeSpan.FromSeconds(5));
canceller.Token.Register(() => Consoul.Write("Console.Read() Timed-out!", ConsoleColor.Red));
// Now wait more than 5 seconds to see the red message in the window
string userInput = Consoul.Read(canceller.Token);
}
Consoul.Write("Finished!", ConsoleColor.Green);
Full Changelog: v1.6.1...v1.6.2