The Task type exposes the following members.
Constructors
Methods
Name | Description | |
---|---|---|
![]() | Abort |
Notifies the task to abort and sets the task state to failed. The task needs to check ShouldAbort if the task should abort.
|
![]() | AbortWait |
Notifies the task to abort and sets the task state to failed. The task needs to check ShouldAbort if the task should abort.
This method will wait until the task has been aborted/ended.
|
![]() | AbortWaitForSeconds |
Notifies the task to abort and sets the task state to failed. The task needs to check ShouldAbort if the task should abort.
This method will wait until the task has been aborted/ended or the given timeout has been reached.
|
![]() ![]() | Create(Action) | |
![]() ![]() | Create(IEnumerator) | |
![]() ![]() | Create(Action<(Of <<'(Task>)>>)) | |
![]() ![]() | Create<(Of <<'(T>)>>)(Func<(Of <<'(T>)>>)) | |
![]() ![]() | Create<(Of <<'(T>)>>)(Func<(Of <<'(Task, T>)>>)) | |
![]() ![]() | Create<(Of <<'(T>)>>)(Object, String, array<Object>[]()[][]) | |
![]() ![]() | Create<(Of <<'(T>)>>)(Type, String, array<Object>[]()[][]) | |
![]() | Dispose |
Disposes this task and waits for completion if its still running.
|
![]() | Do | |
![]() | Finalize | (Overrides Object..::..Finalize()()()().) |
![]() | Run()()()() |
Starts the task.
|
![]() | Run(DispatcherBase) |
Starts the task on the given DispatcherBase (Dispatcher or TaskDistributor).
|
![]() | Wait()()()() |
Blocks the calling thread until the task has been ended.
|
![]() | Wait<(Of <<'(TResult>)>>)()()()() |
Blocks the calling thread until the task has been ended and returns the return value of the task as the given type.
Use this method only for Tasks with return values (functions)!
|
![]() | WaitForSeconds(Single) |
Blocks the calling thread until the task has been ended or the given timeout value has been reached.
|
![]() | WaitForSeconds<(Of <<'(TResult>)>>)(Single) |
Blocks the calling thread until the task has been ended and returns the return value of the task as the given type.
Use this method only for Tasks with return values (functions)!
|
![]() | WaitForSeconds<(Of <<'(TResult>)>>)(Single, TResult) |
Blocks the calling thread until the task has been ended and returns the return value of the task as the given type.
Use this method only for Tasks with return values (functions)!
|
Extension Methods
Name | Description | |
---|---|---|
![]() | As<(Of <<'(T>)>>) |
Converts this Task.
(Defined by TaskExtension.) |
![]() | Await(Task) | Overloaded.
Starts this Task when the other Task ended successfully.
(Defined by TaskExtension.) |
![]() | Await(Task, DispatcherBase) | Overloaded.
Starts this Task when the other Task ended successfully.
(Defined by TaskExtension.) |
![]() | OnResult(Action<(Of <<'(Object>)>>)) | Overloaded.
Invokes the given action with the set result of the task when the task succeeded.
(Defined by TaskExtension.) |
![]() | OnResult(Action<(Of <<'(Object>)>>), DispatcherBase) | Overloaded.
Invokes the given action with the set result of the task when the task succeeded.
(Defined by TaskExtension.) |
![]() | OnResult<(Of <<'(T>)>>)(Action<(Of <<'(T>)>>)) | Overloaded.
Invokes the given action with the set result of the task when the task succeeded.
(Defined by TaskExtension.) |
![]() | OnResult<(Of <<'(T>)>>)(Action<(Of <<'(T>)>>), DispatcherBase) | Overloaded.
Invokes the given action with the set result of the task when the task succeeded.
(Defined by TaskExtension.) |
![]() | RunAsync(String, array<Object>[]()[][]) | Overloaded.
Starts the given Method as async Task on the given TaskDistributor.
(Defined by ObjectExtension.) |
![]() | RunAsync(String, TaskDistributor, array<Object>[]()[][]) | Overloaded.
Starts the given Method as async Task on the given TaskDistributor.
(Defined by ObjectExtension.) |
![]() | RunAsync<(Of <<'(T>)>>)(String, array<Object>[]()[][]) | Overloaded.
Starts the given Method as async Task on the given TaskDistributor.
(Defined by ObjectExtension.) |
![]() | RunAsync<(Of <<'(T>)>>)(String, TaskDistributor, array<Object>[]()[][]) | Overloaded.
Starts the given Method as async Task on the given TaskDistributor.
(Defined by ObjectExtension.) |
![]() | Then(Task) | Overloaded.
Starts the given Task when this Task ended successfully.
(Defined by TaskExtension.) |
![]() | Then(Task, DispatcherBase) | Overloaded.
Starts the given Task when this Task ended successfully.
(Defined by TaskExtension.) |
![]() | WhenEnded(Action) | Overloaded.
The given Action will be performed when the task ends.
(Defined by TaskExtension.) |
![]() | WhenEnded(Action<(Of <<'(Task>)>>)) | Overloaded.
The given Action will be performed when the task ends.
(Defined by TaskExtension.) |
![]() | WhenEnded(Action<(Of <<'(Task>)>>), DispatcherBase) | Overloaded.
The given Action will be performed when the task ends.
(Defined by TaskExtension.) |
![]() | WhenFailed(Action) | Overloaded.
The given Action will be performed when the task fails.
(Defined by TaskExtension.) |
![]() | WhenFailed(Action<(Of <<'(Task>)>>)) | Overloaded.
The given Action will be performed when the task fails.
(Defined by TaskExtension.) |
![]() | WhenFailed(Action<(Of <<'(Task>)>>), DispatcherBase) | Overloaded.
The given Action will be performed when the task fails.
(Defined by TaskExtension.) |
![]() | WhenSucceeded(Action) | Overloaded.
The given Action will be performed when the task succeeds.
(Defined by TaskExtension.) |
![]() | WhenSucceeded(Action<(Of <<'(Task>)>>)) | Overloaded.
The given Action will be performed when the task succeeds.
(Defined by TaskExtension.) |
![]() | WhenSucceeded(Action<(Of <<'(Task>)>>), DispatcherBase) | Overloaded.
The given Action will be performed when the task succeeds.
(Defined by TaskExtension.) |
Fields
Name | Description | |
---|---|---|
![]() | Priority |
Change this when you work with a prioritzable Dispatcher or TaskDistributor to change the execution order
lower values will be executed first.
|
![]() | TaskEnded |
Will be called when the task has been finished (success or failure or aborted).
This event will be fired at the thread the task was running at.
|
Properties
Name | Description | |
---|---|---|
![]() ![]() | Current |
Returns the currently ThreadBase instance which is running in this thread.
|
![]() | HasEnded |
Returns true when processing of this task has been ended or has been skipped due early abortion.
|
![]() | IsEnding |
Returns true when processing of this task is ending.
|
![]() | IsFailed |
Returns true if the task should abort and has been ended. This value will not been set to true
in case of an exception while processing this task. The user needs to add checks for these kind of situation.
|
![]() | IsSucceeded |
Returns true when the task has successfully been processed. Tasks which throw exceptions will
not be set to a failed state, also any exceptions will not be catched, the user needs to add
checks for these kind of situation.
|
![]() | RawResult | |
![]() | ShouldAbort |
Returns true if the task should abort. If a Task should abort and has not yet been started
it will never start but indicate an end and failed state.
|