Class BowireScriptLimits

Namespace
Kuestenlogik.Bowire.Scripting
Assembly
Kuestenlogik.Bowire.dll

The sandbox's limits. A script that reaches one is stopped and reported, so a runaway script fails its call rather than the run. The caller fills them from configuration (Bowire:Scripting:*); these are the values when it sets none.

public sealed record BowireScriptLimits : IEquatable<BowireScriptLimits>
Inheritance
BowireScriptLimits
Implements
Inherited Members

Constructors

BowireScriptLimits()

public BowireScriptLimits()

Properties

MaxRequests

#1111 — how many ctx.sendRequest calls one script may make.

public int MaxRequests { get; init; }

Property Value

int

MaxStatements

Statements the script may execute.

public int MaxStatements { get; init; }

Property Value

int

MemoryBytes

Memory the script may allocate, in bytes.

public long MemoryBytes { get; init; }

Property Value

long

Timeout

Wall-clock time per script.

public TimeSpan Timeout { get; init; }

Property Value

TimeSpan

Methods

Equals(BowireScriptLimits?)

public bool Equals(BowireScriptLimits? other)

Parameters

other BowireScriptLimits

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

FromConfiguration(IConfiguration?)

The limits Bowire:Scripting:TimeoutMs, MemoryMb and MaxStatements set, the defaults for any left out. One reader for bowire test and the workbench (#1062), so a limit means the same in both.

public static BowireScriptLimits FromConfiguration(IConfiguration? cfg)

Parameters

cfg IConfiguration

Returns

BowireScriptLimits

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(BowireScriptLimits?, BowireScriptLimits?)

public static bool operator ==(BowireScriptLimits? left, BowireScriptLimits? right)

Parameters

left BowireScriptLimits
right BowireScriptLimits

Returns

bool

operator !=(BowireScriptLimits?, BowireScriptLimits?)

public static bool operator !=(BowireScriptLimits? left, BowireScriptLimits? right)

Parameters

left BowireScriptLimits
right BowireScriptLimits

Returns

bool