Table of Contents

Class TaskSyncEntity<T>

Namespace
ReFuel.Ecs
Assembly
ReFuel.dll

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

int

OwnerThread

The thread that owns the queue, if set.

public Thread? OwnerThread { get; }

Property Value

Thread

TaskWatchdog

The watchdog timer to be used during task execution.

public Watchdog? TaskWatchdog { get; set; }

Property Value

Watchdog

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 T

The work item to enqueue.

Initialize()

public void Initialize()

Initialize(TaskSyncEntityCreateInfo)

public void Initialize(TaskSyncEntityCreateInfo t1)

Parameters

t1 TaskSyncEntityCreateInfo