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
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
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
CreateOptionsOptions to create Script API environment with.
cancellationToken
CancellationTokenCancellation token that allows the caller to cancel the operation.
Returns
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.