JsExecutionLimits Class

The limits of an execution scope (JsEngine.EnterExecutionScope): they apply to all the code that runs in the scope as a whole (the scripts, the calls, the jobs, the parsing of the sources), in addition to the limits of JsEngineOptions. A limit that is exceeded stops the code with a JsTerminationException.

public sealed class JsExecutionLimits

Constructors

NameDescription
JsExecutionLimits()

JsExecutionLimits()

public JsExecutionLimits()

No documentation is available.

Properties

NameDescription
CancellationTokenGets the token that stops the code of the scope when it is canceled (JsTerminationReason.Canceled). It can be canceled from any thread, e.g. to stop a request whose client is gone.
MaxStatementsGets the maximum number of statements of the scope, or null for no limit (see JsEngineOptions.MaxStatements).
MemoryLimitGets the maximum number of bytes allocated by the thread in the scope, or null for no limit (see JsEngineOptions.MemoryLimit).
TimeoutGets the maximum duration of the scope, or null for no limit.

CancellationToken

JsExecutionLimits.cs

Gets the token that stops the code of the scope when it is canceled (JsTerminationReason.Canceled). It can be canceled from any thread, e.g. to stop a request whose client is gone.

public CancellationToken CancellationToken { get; init; }

Property value

CancellationToken

Gets the maximum number of statements of the scope, or null for no limit (see JsEngineOptions.MaxStatements).

public long? MaxStatements { get; init; }

Property value

long?

Gets the maximum number of bytes allocated by the thread in the scope, or null for no limit (see JsEngineOptions.MemoryLimit).

public long? MemoryLimit { get; init; }

Property value

long?

Gets the maximum duration of the scope, or null for no limit.

public TimeSpan? Timeout { get; init; }

Property value

TimeSpan?