Skip to content

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

Task<RawReplResult>

The execution result.

Exceptions

InvalidOperationException

Thrown when concurrent operations are detected or object is disposed.

ArgumentNullException

Thrown when command is null.

Released under the Apache License 2.0.