Table of Contents

Class RuntimeSchedule

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Fluent builder for constructing a runtime schedule — the public API game developers use to declare the Track → DAG → Phase → System hierarchy and build a DagScheduler.

public sealed class RuntimeSchedule
Inheritance
RuntimeSchedule
Inherited Members

Remarks

A schedule owns three built-in Tracks — Engine-Pre, PublicTrack, Engine-Post — in that execution order. Apps declare their DAGs on the Public track (schedule.PublicTrack.DeclareDag("Game").Add(...)) and may add further app tracks via DeclareTrack(string, params string[]); those slot into the app region between Public and Engine-Post in declaration (execution) order. The engine declares its own DAGs (the Fence) on the Engine-Post track. Declaring a DAG is mandatory — there is no default-DAG convenience.

Properties

EnginePostTrack

The built-in Engine-Post track — engine work after the app (currently the parallel Fence DAG).

public Track EnginePostTrack { get; }

Property Value

Track

EnginePreTrack

The built-in Engine-Pre track — engine work before the app. Empty initially; declared for symmetry.

public Track EnginePreTrack { get; }

Property Value

Track

PublicTrack

The built-in Public track — the app declares its DAGs here.

public Track PublicTrack { get; }

Property Value

Track

Tracks

All tracks in execution order: Engine-Pre, Public, any app tracks (see DeclareTrack(string, params string[])), Engine-Post.

public IReadOnlyList<Track> Tracks { get; }

Property Value

IReadOnlyList<Track>

Methods

Build(IResource, ILogger)

Validates the schedule and builds a DagScheduler.

public DagScheduler Build(IResource parent, ILogger logger = null)

Parameters

parent IResource

Parent resource node (typically Runtime).

logger ILogger

Optional logger.

Returns

DagScheduler

A ready-to-start DagScheduler.

Exceptions

InvalidOperationException

A DAG contains a cycle, duplicate names, or invalid references.

Consumes(string, params EventQueueBase[])

Declares that a system consumes (reads from) the specified event queues.

public RuntimeSchedule Consumes(string systemName, params EventQueueBase[] queues)

Parameters

systemName string
queues EventQueueBase[]

Returns

RuntimeSchedule

Create(RuntimeOptions)

Creates a new runtime schedule builder.

public static RuntimeSchedule Create(RuntimeOptions options = null)

Parameters

options RuntimeOptions

Runtime configuration. If null, defaults are used.

Returns

RuntimeSchedule

CreateEventQueue<T>(string, int)

Creates a typed event queue for inter-system communication.

public EventQueue<T> CreateEventQueue<T>(string name, int capacity = 1024)

Parameters

name string

Diagnostic name for the queue.

capacity int

Maximum events per tick. Must be a power of 2.

Returns

EventQueue<T>

Type Parameters

T

Event type.

DeclareTrack(string, params string[])

Declares an application Track and appends it to the app region — after PublicTrack and any previously declared app tracks, before the engine's Engine-Post track. Declaration order is execution order: every DAG of a track completes before any DAG of the next track begins (a coarse engine-level barrier).

public Track DeclareTrack(string name, params string[] tags)

Parameters

name string

Track name — must be non-empty, unique across the schedule, and must not start with the reserved Engine- prefix.

tags string[]

Optional open tag set for tooling. The reserved EngineTag is rejected.

Returns

Track

The new track — declare DAGs on it via DeclareDag(string).

Exceptions

InvalidOperationException

The schedule is already built, the name duplicates an existing track or uses the reserved prefix, or the tag set contains the engine tag.

Produces(string, params EventQueueBase[])

Declares that a system produces (writes to) the specified event queues.

public RuntimeSchedule Produces(string systemName, params EventQueueBase[] queues)

Parameters

systemName string
queues EventQueueBase[]

Returns

RuntimeSchedule