Skip to content

WorkOption

ZjzMisaka edited this page May 19, 2024 · 8 revisions

Properties

The custom work ID. If set to null, the thread pool will use a Guid as the work ID.

string CustomWorkID;

The group name of the work.

string Group;

The maximum amount of time the work is allowed to run before it is terminated.

TimeoutOption Timeout;

The callback function that is called when the work finishes execution.

Action<ExecuteResult<TResult>> Callback;

The priority level of the work. Higher priority works are executed before lower priority works.

int WorkPriority;

Specifies the scheduling priority of a System.Threading.Thread.

ThreadPriority ThreadPriority;

Get/Set backgroundness of thread in thread pool.

bool IsBackground;

A set of works that this work depends on. This work will not start until all dependent works have completed execution.

ConcurrentSet<string> Dependents;

Is long running work.

bool LongRunning;

Retry the work if execute failed.

RetryOption RetryOption;

Should storage the work result.

bool StorageResult;