Skip to content
ConsoleMonster
Class

LiveRun

ConsoleMonster.Live

Namespace
ConsoleMonster.Live
Assembly
ConsoleMonster
Implements
IDisposable
Modifiers
sealed

Monitors an existing runner without scheduling its work or changing its results. Completed items are appended once to scrollback; a bounded dashboard shows active work and problems. All update methods are safe from worker threads.

Inheritance

  • object
  • LiveRun

Constructors

public LiveRun(IEnumerable<RunItem> items, LiveRunOptions? options = null) #

Starts monitoring the declared work. No item is executed by this constructor.

Parameters

items System.Collections.Generic.IEnumerable<ConsoleMonster.Live.RunItem> required
Names, targets and optional categories in input order.
options ConsoleMonster.Live.LiveRunOptions? = null optional
Display configuration, or null for defaults.

Methods

public void Cancel() #

Signals cooperative cancellation while leaving completion output open.

public RunSnapshot Complete() #

Marks unfinished items skipped, flushes held completion lines and prints the full final summary. Idempotent.

Returns

RunSnapshot The final structured state. The runner's own results and exit code are unaffected.

Exceptions

  • InvalidOperationException – Output failed. The complete structured state is retained by Snapshot.
public void Dispose() #

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Finished(int index, StatusKind outcome, string? message = null, TimeSpan? duration = null) #

Completes an item once. Repeated completion notifications are ignored.

Parameters

index int required
Zero-based input position.
outcome ConsoleMonster.Styling.StatusKind required
Pass, Fail, Warn or Skip.
message string? = null optional
Full literal result detail.
duration System.TimeSpan? = null optional
Explicit elapsed time, or null to use the item's running clock.
public bool Flush(TimeSpan timeout) #

Waits for previously posted output to reach the target. After Complete, waits for final output and restoration, including deferred cleanup. Hosts can then drain their output on their pipeline thread.

Parameters

timeout System.TimeSpan required
Maximum wait.

Returns

bool Whether output was flushed.
public bool HandleKey(char key) #

Applies an optional dashboard key. This changes display only; work continues.

Parameters

key char required
p, f, g or ?.

Returns

bool Whether the key was handled.
public RunSnapshot Snapshot() #

A consistent immutable observation of the run.

Returns

RunSnapshot Items, totals, running phases and throughput.
public void Started(int index, string? phase = null) #

Starts one item or changes its running phase. Duplicate starts preserve its original start time.

Parameters

index int required
Zero-based input position.
phase string? = null optional
Literal phase text.

Properties

public RunDashboard Dashboard { get; } #

The live presentation; its log retains only its configured capacity, while scrollback receives every completion.

public CancellationToken Cancellation { get; } #

Cancelled by Ctrl+C or LiveRun.Cancel. Producers should observe it and report their last results before Complete.

public Exception? OutputFailure { get; } #

A fatal rendering or output failure, including final summary and flushing failures. Worker results remain in the structured snapshot.

public bool IsLive { get; } #

Whether the target supports live redraw for this run.