ShapeBudget
ConsoleMonster.Values
The time and node allowance of one shaping pass. Getters that reach a remote system (directory entries, COM objects, lazy collections) can take seconds each; once the allowance is spent the remaining values are not read and show as "…" instead of stalling the output.
Inheritance
- object
- ShapeBudget
Usage
Explore 7 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.
Returned or exposed by 1
- Method ShapeBudget.For
Accepted by parameters 6
- Method ValueShaper.Cell
- Method ValueShaper.Flatten
- Method ValueShaper.Read
- Method ValueShaper.Text
- Method ValueShaper.Title
- Method ValueShaper.TryGetField
Constructors
public ShapeBudget(TimeSpan time, int maxNodes) #Creates a budget.
Parameters
- time System.TimeSpan
- How long the pass may take.
- maxNodes int
- How many values it may read.
Methods
public static ShapeBudget For(ShapeOptions? options) #A budget from options.
Parameters
- options ConsoleMonster.Values.ShapeOptions?
- The options, or null for the defaults.
public object? Guard(object source, Func<object?> read) #Runs one read for a source (a column, a field), timing it. Reads slower than 200 ms count as stalls; once the stalls add up to the time allowance, only sources that have already read quickly are still read (the others give BudgetExceeded), so a large but healthy table is never cut short and remote getters cannot hold it up.
Parameters
- source object
- What is read (a column or field identity).
- read System.Func<object?>
- The read.
public bool TryTake() #Counts one read; returns false (and remembers it) when the allowance is spent.
Returns
bool True when the value may be read.Inherited Methods
Properties
public bool WasExceeded { get; private set; } #Whether the pass stopped reading at some point.