Search Results for

    Show / Hide Table of Contents

    Class ForegroundTaskScheduler

    An implementation of TaskScheduler that uses an Evergine service to enqueue tasks.

    Inheritance
    object
    TaskScheduler
    ForegroundTaskScheduler
    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 has 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
    TaskScheduler.GetScheduledTasks()
    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 queue.

    Overrides
    TaskScheduler.QueueTask(Task)

    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 the 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.

    Overrides
    TaskScheduler.TryExecuteTaskInline(Task, bool)

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX