LuciadCPillar C# 2023.1.05
Luciad.Concurrent.ICancellableTask Interface Reference

A task that can be canceled. More...

Public Member Functions

void Cancel ()
 Signals that the task should be canceled. More...
 
void Run ()
 Executes the cancellable task and waits for it to finish. More...
 

Detailed Description

A task that can be canceled.

The task is launched by calling the run() method. While the task is executing, if another thread calls the cancel() method of that task, then it gets the opportunity to signal that the run() method should stop executing and return early. This can be achieved either by e.g. setting an atomic flag that the run method will periodically check, or by calling a specific abort method on an external API (e.g. a Http request class). 2022.1

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ICancellableTask.

Member Function Documentation

◆ Cancel()

void Luciad.Concurrent.ICancellableTask.Cancel ( )

Signals that the task should be canceled.

Can be called from any thread. Calling this method synchronously before calling run() prevents run() from doing any work, while calling it synchronously after run() has no effect.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ICancellableTask::cancel.

◆ Run()

void Luciad.Concurrent.ICancellableTask.Run ( )

Executes the cancellable task and waits for it to finish.

This call is synchronous, and thus blocking.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::ICancellableTask::run.