Skip to content
ConsoleMonster

API Reference

Class

ShapeBudget

Namespace ConsoleMonster.Values
Assembly ConsoleMonster
Modifiers sealed

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

Accepted by parameters 6

Constructors

public ShapeBudget(TimeSpan time, Int32 maxNodes) #

Creates a budget.

Parameters

time System.TimeSpan requiredposition: 0
How long the pass may take.
maxNodes System.Int32 requiredposition: 1
How many values it may read.

Methods

public static ShapeBudget For(ShapeOptions? options) #
Returns: ShapeBudget

A budget from options.

Parameters

options ConsoleMonster.Values.ShapeOptions? requiredposition: 0
The options, or null for the defaults.

Returns

The budget.

public Object? Guard(Object source, Func<Object?> read) #
Returns: Object?

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 System.Object requiredposition: 0
What is read (a column or field identity).
read System.Func<System.Object?> requiredposition: 1
The read.

Returns

The value, or BudgetExceeded.Instance.

public Boolean TryTake() #
Returns: Boolean

Counts one read; returns false (and remembers it) when the allowance is spent.

Returns

True when the value may be read.

Properties

public Int32 MaxNodes { get; } #

The most values the pass may read.

public Boolean Exhausted { get; } #

Whether the allowance is spent (time or nodes).

public Boolean WasExceeded { get; private set; } #

Whether the pass stopped reading at some point.