Skip to content
ConsoleMonster
Class

RunOptions

ConsoleMonster.Live

Namespace
ConsoleMonster.Live
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

Options for ConsoleRun.ForEachAsync and RunMonitor.

Inheritance

  • object
  • RunOptions

Usage

Explore 39 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 21

Constructors

public RunOptions() #

Properties

public int ThrottleLimit { get; set; } #

How many items run at the same time (default the processor count).

public TimeSpan? Timeout { get; set; } #

The time one item may take, or null for no limit; an item past it is cancelled and counts as failed.

public int RetryCount { get; set; } #

How many more times a failed or timed-out item runs before it counts as failed (default 0). Cancelling the run does not retry.

public TimeSpan RetryDelay { get; set; } #

The pause before each retry (default none).

public string? Title { get; set; } #

A title above the live view (markup), or null.

public Func<object?, string>? Label { get; set; } #
Fluent("LabelBy")

The label of an item in the view, or null for its title (a name-like property, or its text).

public bool? Live { get; set; } #

Whether to show the live view (true), print a line per item (false) or decide from the terminal (null, default).

public LiveSessionOptions? Session { get; set; } #

The live session's options (inline with the final frame kept, by default).

public Action<string>? Print { get; set; } #
Fluent("WriteTo")

Where a printed line goes when the view is not live, or null for the current terminal.

Extension Methods

public static RunOptions LabelBy(RunOptions runOptions, Func<object?, string>? value) #

Sets RunOptions.Label: The label of an item in the view, or null for its title (a name-like property, or its text).

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value System.Func<object?, string>? required
The callback.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ConsoleMonster.Live.RunOptions { Label = value };    runOptions.LabelBy(value);
public static RunOptions Live(RunOptions runOptions, bool? value) #

Sets RunOptions.Live: Whether to show the live view (true), print a line per item (false) or decide from the terminal (null, default).

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value bool? required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                   // C# fluent
new global::ConsoleMonster.Live.RunOptions { Live = value };    runOptions.Live(value);
public static RunOptions RetryCount(RunOptions runOptions, int value) #

Sets RunOptions.RetryCount: How many more times a failed or timed-out item runs before it counts as failed (default 0). Cancelling the run does not retry.

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value int required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Live.RunOptions { RetryCount = value };    runOptions.RetryCount(value);
public static RunOptions RetryDelay(RunOptions runOptions, TimeSpan value) #

Sets RunOptions.RetryDelay: The pause before each retry (default none).

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value System.TimeSpan required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Live.RunOptions { RetryDelay = value };    runOptions.RetryDelay(value);
Session 2 overloads
public static RunOptions Session(RunOptions runOptions, LiveSessionOptions? value) #

Sets RunOptions.Session: The live session's options (inline with the final frame kept, by default).

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value ConsoleMonster.Live.LiveSessionOptions? required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ConsoleMonster.Live.RunOptions { Session = value };    runOptions.Session(value);
public static RunOptions Session(RunOptions runOptions, Action<LiveSessionOptions> configure) #

Configures RunOptions.Session in place (creating it when not set): The live session's options (inline with the final frame kept, by default).

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
configure System.Action<ConsoleMonster.Live.LiveSessionOptions> required
Configures the value.

Returns

RunOptions The same instance.
public static RunOptions ThrottleLimit(RunOptions runOptions, int value) #

Sets RunOptions.ThrottleLimit: How many items run at the same time (default the processor count).

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value int required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Live.RunOptions { ThrottleLimit = value };    runOptions.ThrottleLimit(value);
public static RunOptions Timeout(RunOptions runOptions, TimeSpan? value) #

Sets RunOptions.Timeout: The time one item may take, or null for no limit; an item past it is cancelled and counts as failed.

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value System.TimeSpan? required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ConsoleMonster.Live.RunOptions { Timeout = value };    runOptions.Timeout(value);
public static RunOptions Title(RunOptions runOptions, string? value) #

Sets RunOptions.Title: A title above the live view (markup), or null.

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value string? required
The value.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ConsoleMonster.Live.RunOptions { Title = value };    runOptions.Title(value);
public static RunOptions WriteTo(RunOptions runOptions, Action<string>? value) #

Sets RunOptions.Print: Where a printed line goes when the view is not live, or null for the current terminal.

Parameters

runOptions ConsoleMonster.Live.RunOptions required
The instance.
value System.Action<string>? required
The callback.

Returns

RunOptions The same instance.

Examples

// C# initializer or property                                    // C# fluent
new global::ConsoleMonster.Live.RunOptions { Print = value };    runOptions.WriteTo(value);