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

TaskPrivate constructor.

Properties

AbortedReturns true if task was aborted from Progress Handler.
AsyncCompletedReturns true if Async run has completed.
BooleanResultBoolean result for the task or false if there was no result or the result type is not Boolean.
DoubleResultDouble result for the task or 0.0 if there was no result or the result type is not Double.
IntegerResultInteger result for the task or zero if there was no result or the result type is not Integer.
ResultObject result for the task or nil if there was no result or the result type is not Object.
StringResultString result for the task or empty string if there was no result or the result type is not String.
TargetReturns the target object of the task. Or nil if the task originates from Shared method.
VariantResultVariant result for the task.

Methods

RunRuns the task as non threaded code. This method is mostly meant to test and diagnose if there is problem with running in native thread.
RunAsyncRuns the task asynchronously.
SetCancellationTokenSets cancellation token for the class.
WaitForWaitFor 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