Method ExecuteAsync
Namespace: Belay.Core
Assembly: Belay.Core.dll
ExecuteAsync(string, int, CancellationToken)
Executes Python code and returns the result. Based on official mpremote exec_raw implementation.
csharp
public Task<RawReplResult> ExecuteAsync(string command, int timeoutSeconds = 10, CancellationToken cancellationToken = default)
Parameters
command
string
The Python code to execute.
timeoutSeconds
int
Timeout in seconds for the operation.
cancellationToken
CancellationToken
Cancellation token.
Returns
The execution result.
Exceptions
Thrown when concurrent operations are detected or object is disposed.
Thrown when command is null.