TypeLib Xojo support Plugin |

# EinhugurRuntime.Task Class (console safe)

A class representing a task that runs on Native threads. Multiple CPU cores can be used across multiple tasks.
Best case scenario is when Entry and Exit are as small work as possible.
Entry is ran when Task object is created. Typically Entry would create relevant Xojo object which cannot be done in Native thread space.
Exit ran after the native thread, and in most cases will be clean up of Xojo objects that cannot be cleaned in native thread space. Like the Entry the bast case is when this portion is as small as possible.
Tasks can make use of multiple CPU cores, if creating multiple tasks and starting them with RunAsync.

Object
Task

class EinhugurRuntime.Task

#### Constructors

Task | Private constructor.

#### Properties

Aborted | Returns true if task was aborted from Progress Handler.
AsyncCompleted | Returns true if Async run has completed.
BooleanResult | Boolean result for the task or false if there was no result or the result type is not Boolean.
DoubleResult | Double result for the task or 0.0 if there was no result or the result type is not Double.
IntegerResult | Integer result for the task or zero if there was no result or the result type is not Integer.
Result | Object result for the task or nil if there was no result or the result type is not Object.
StringResult | String result for the task or empty string if there was no result or the result type is not String.
Target | Returns the target object of the task. Or nil if the task originates from Shared method.
VariantResult | Variant result for the task.

#### Methods

Run | Runs the task as non threaded code. This method is mostly meant to test and diagnose if there is problem with running in native thread.
RunAsync | Runs the task asynchronously.
SetCancellationToken | Sets cancellation token for the class.
WaitFor | WaitFor is convenience method which runs the task asynchronously and does do event loop to wait.

#### Delegates

TaskCompletedDelegate (console safe) | Delegate to receive completed signal when task run in async mode finishes.

#### Supported Platforms:

- macOS Intel 64 bit
- macOS Apple Silicon
- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit
- iOS