Class ForegroundTaskScheduler
An implementation of TaskScheduler that uses a Evergine Service to enqueue tasks.
Inherited Members
Namespace: Evergine.Framework.Threading
Assembly: Evergine.Framework.dll
Syntax
public class ForegroundTaskScheduler : TaskScheduler
Properties
Foreground
Gets the instance of ForegroundTaskScheduler.
Declaration
public static ForegroundTaskScheduler Foreground { get; }
Property Value
Type | Description |
---|---|
ForegroundTaskScheduler |
Methods
Configure(Container)
Configures the ForegroundTaskScheduler to use the ForegroundTaskSchedulerService.
Declaration
public void Configure(Container container)
Parameters
Type | Name | Description |
---|---|---|
Container | container | The application container that have registered a ForegroundTaskSchedulerService. |
GetScheduledTasks()
Generates an enumerable of Task instances currently queued to the scheduler waiting to be executed.
Declaration
protected override IEnumerable<Task> GetScheduledTasks()
Returns
Type | Description |
---|---|
IEnumerable<Task> | An enumerable that allows traversal of tasks currently queued to this scheduler. |
Overrides
Exceptions
Type | Condition |
---|---|
NotSupportedException | This scheduler is unable to generate a list of queued tasks at this time. |
QueueTask(Task)
Queues a Task to the scheduler.
Declaration
protected override void QueueTask(Task task)
Parameters
Type | Name | Description |
---|---|---|
Task | task | The Task to be queued. |
Overrides
TryExecuteTaskInline(Task, bool)
Determines whether the provided Task can be executed synchronously in this call, and if it can, executes it.
Declaration
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
Parameters
Type | Name | Description |
---|---|---|
Task | task | The Task to be executed. |
bool | taskWasPreviouslyQueued | A Boolean denoting whether or not task has previously been queued. If this parameter is True, then the task may have been previously queued (scheduled); if False, then the task is known not to have been queued, and this call is being made in order to execute the task inline without queuing it. |
Returns
Type | Description |
---|---|
bool | A Boolean value indicating whether the task was executed inline. |