Class MainThreadWorkItemDispatcher
MainThreadWorkItemDispatcher handles execution of WorkItems by directly executing them on the main thread. This is different from the SimpleWorkItemDispatcher where the work item is dispatched onto its own thread.
public class MainThreadWorkItemDispatcher : IWorkItemDispatcher
- Inheritance
-
MainThreadWorkItemDispatcher
- Implements
- Inherited Members
Constructors
MainThreadWorkItemDispatcher()
public MainThreadWorkItemDispatcher()
Properties
LevelOfParallelism
The level of parallelism supported
public int LevelOfParallelism { get; }
Property Value
Methods
CancelRun(bool)
This method is not supported for this dispatcher. Using it will throw a NotSupportedException.
public void CancelRun(bool force)
Parameters
force
boolNot used
Exceptions
- NotSupportedException
If used, it will always throw this.
Dispatch(WorkItem)
Dispatch a single work item for execution by executing it directly.
public void Dispatch(WorkItem work)
Parameters
work
WorkItemThe item to dispatch
Start(WorkItem)
Start execution, dispatching the top level work into the main thread.
public void Start(WorkItem topLevelWorkItem)
Parameters
topLevelWorkItem
WorkItem