Class TaskBase<TSelf, TResult>
Inheritance
object
TaskBase<TSelf, TResult>
Assembly: .dll
Syntax
public abstract class TaskBase<TSelf, TResult> where TSelf : TaskBase<TSelf, TResult>
Type Parameters
Name |
Description |
TSelf |
|
TResult |
|
Properties
Api
Declaration
public virtual Api Api { get; set; }
Property Value
Cts
Declaration
public CancellationTokenSource Cts { get; }
Property Value
Type |
Description |
CancellationTokenSource |
|
IgnoreLogs
Declaration
public bool IgnoreLogs { get; }
Property Value
IsCanceled
Declaration
public bool IsCanceled { get; }
Property Value
IsWrapperTask
Declaration
public virtual bool IsWrapperTask { get; }
Property Value
Method
Declaration
public abstract string Method { get; }
Property Value
RequestMimeType
Declaration
public virtual MIMEType RequestMimeType { get; set; }
Property Value
Type |
Description |
MIMEType |
|
ResponseMimeType
Declaration
public virtual MIMEType ResponseMimeType { get; set; }
Property Value
Type |
Description |
MIMEType |
|
Sender
Declaration
public string Sender { get; }
Property Value
Token
Declaration
public CancellationToken Token { get; set; }
Property Value
Type |
Description |
CancellationToken |
|
Methods
CancelTask()
Cancels the current GENTask.
Declaration
ExecuteAsync()
Executes the task and returns the output of type TResult
.
This is the main entry point for executing the task.
Declaration
public virtual UniTask<TResult> ExecuteAsync()
Returns
Type |
Description |
UniTask<TResult> |
|
ExecuteAsyncINTERNAL()
Declaration
protected abstract UniTask<TResult> ExecuteAsyncINTERNAL()
Returns
Type |
Description |
UniTask<TResult> |
|
ExecuteAsync<T>()
Interface method to execute the task and return a specific type.
This is useful for tasks that return a specific type of output.
Mainly used internally for GENSequence.
Declaration
public UniTask<T> ExecuteAsync<T>()
Returns
Type |
Description |
UniTask<T> |
|
Type Parameters
Exceptions
Type |
Condition |
InvalidOperationException |
|
SetCancellationToken(CancellationToken)
Sets a custom cancellation token for this task.
Declaration
public TSelf SetCancellationToken(CancellationToken token)
Parameters
Type |
Name |
Description |
CancellationToken |
token |
|
Returns
SetIgnoreLogs(bool)
Ignores logs for this task.
This is useful for tasks that are not intended to produce logs or when you want to suppress logs.
Declaration
public TSelf SetIgnoreLogs(bool ignoreLogs)
Parameters
Type |
Name |
Description |
bool |
ignoreLogs |
|
Returns
SetSender(string)
Sets the sender ID for tracking or attribution purposes.
Declaration
public TSelf SetSender(string sender)
Parameters
Type |
Name |
Description |
string |
sender |
|
Returns