Table of Contents

Method CreateAsync

Namespace
WhalesSecret.ScriptApiLib
Assembly
WhalesSecret.ScriptApiLib.dll

CreateAsync(CancellationToken)

Creates a new instance of the script API with initialized script environment with default create options.

public static Task<ScriptApi> CreateAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token that allows the caller to cancel the operation.

Returns

Task<ScriptApi>

Script API with initialized and running script environment.

Exceptions

MalfunctionException

Thrown if the initialization of core components fails.

InvalidProductLicenseException

Thrown if the license provided in the options is invalid.

FileAccessException

Thrown if it is not possible to create the data folder.

AlreadyExistsException

Thrown if another instance is already operating on the given data folder.

OperationCanceledException

Thrown if the operation was cancelled.

CreateAsync(CreateOptions, CancellationToken)

Creates a new instance of the script API with initialized script environment.

public static Task<ScriptApi> CreateAsync(CreateOptions createOptions, CancellationToken cancellationToken = default)

Parameters

createOptions CreateOptions

Options to create Script API environment with.

cancellationToken CancellationToken

Cancellation token that allows the caller to cancel the operation.

Returns

Task<ScriptApi>

Script API with initialized and running script environment.

Exceptions

MalfunctionException

Thrown if the initialization of core components fails.

InvalidProductLicenseException

Thrown if the license provided in the options is invalid.

FileAccessException

Thrown if it is not possible to create the data folder.

AlreadyExistsException

Thrown if another instance is already operating on the given data folder.

OperationCanceledException

Thrown if the operation was cancelled.