<PackageReference Include="Microsoft.Bcl" Version="1.1.9" />

System.Threading.Tasks.TaskScheduler

public abstract class TaskScheduler
Represents an abstract scheduler for tasks.
public static TaskScheduler Current { get; }

Gets the TaskSchedulerTaskScheduler associated with the currently executing task.

public static TaskScheduler Default { get; }

Gets the default TaskSchedulerTaskScheduler instance.

public int Id { get; }

Gets the unique ID for this TaskScheduler.

public virtual int MaximumConcurrencyLevel { get; }

Indicates the maximum concurrency level this TaskScheduler is able to support.

Occurs when a faulted Task's unobserved exception is about to trigger exception escalation policy, which, by default, would terminate the process.

protected TaskScheduler()

Initializes the TaskScheduler.

Creates a TaskScheduler associated with the current SynchronizationContext.

protected abstract IEnumerable<Task> GetScheduledTasks()

Generates an enumerable of TaskTask instances currently queued to the scheduler waiting to be executed.

protected bool TryExecuteTask(Task task)

Attempts to execute the provided TaskTask on this scheduler.

protected abstract bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)

Determines whether the provided TaskTask can be executed synchronously in this call, and if it can, executes it.