Method ExecuteAsync
- Namespace
- WhalesSecret.TradeScriptLib
- Assembly
- WhalesSecret.TradeScriptLib.dll
ExecuteAsync(string, CancellationToken)
Method that is called every time when user requests to execute the trade script with parameters specified in jsonInput
.
Task<ScriptResult> ExecuteAsync(string jsonInput, CancellationToken cancellationToken)
Parameters
jsonInput
stringParameters in JSON format. Each script defines its own JSON schema for input parameters.
cancellationToken
CancellationTokenCancellation token that can be used to cancel trade script processing, if trade script author implements it. The cancellation can be invoked by the user or the system when it is shutting down (i.e. when the user terminates the application). There is a timeout within which the execution of this method must finish after the cancellation is invoked. Hence once the cancellation is triggered, this method should complete as soon as possible.
Returns
- Task<ScriptResult>
ScriptResult that describes how the execution of the trade script finished.