Class TaskSyncEntity<T>
Creates an entity that can be used to synchronize tasks onto a thread.
public class TaskSyncEntity<T> : Entity, IDisposable, IEnumerable<EcsNode>, IEnumerable, IInitializer, IInitializer<TaskSyncEntityCreateInfo>, IInitializerBase where T : Task
Type Parameters
T
The task type.
- Inheritance
-
TaskSyncEntity<T>
- Implements
- Inherited Members
Properties
ItemCount
The number of items currently in the work items queue.
public int ItemCount { get; }
Property Value
OwnerThread
The thread that owns the queue, if set.
public Thread? OwnerThread { get; }
Property Value
TaskWatchdog
The watchdog timer to be used during task execution.
public Watchdog? TaskWatchdog { get; set; }
Property Value
Methods
Dispatch()
Dispatch all queued events.
public IEnumerable<T> Dispatch()
Returns
- IEnumerable<T>
The work items.
Exceptions
- InvalidOperationException
Thrown when the non-owning thread calls Dispatch(), if set.
Enqueue(T)
Enqueue a work item into the queue..
public void Enqueue(T workItem)
Parameters
workItem
TThe work item to enqueue.
Initialize()
public void Initialize()
Initialize(TaskSyncEntityCreateInfo)
public void Initialize(TaskSyncEntityCreateInfo t1)