Class
ConsoleWatch
ConsoleMonster.Live
Runs a function again and again and shows its latest result as a live view (the way watch does): the heading counts the runs, changed cells can be highlighted, a failed run shows its error and the watch goes on. On a terminal that is not interactive (redirected output, CI) the current view is printed once, or Count times when supplied. Watch-Console is the PowerShell face.
Inheritance
- object
- ConsoleWatch
Methods
public static int Run(Func<int, IWidget> produce, WatchOptions? options = null, CancellationToken cancellationToken = default) #Watches until cancelled or WatchOptions.Count runs have finished.
Parameters
- produce System.Func<int, ConsoleMonster.Layout.IWidget>
- Builds the view of one run, given its number (1 for the first). It runs on the calling thread.
- options ConsoleMonster.Live.WatchOptions? = null
- Options, or null for the defaults.
- cancellationToken System.Threading.CancellationToken = default
- Ends the watch; the final frame stays.
Returns
int The number of runs.