SmartTableDispatcher.h

Where a model's ordering work runs.

Source/SmartTables/Public/SmartTableDispatcher.h

A model sorting a million rows off the game thread needs somewhere to put the work. These two are what ships: one hands it to UE::Tasks, the other runs it right here. A game with its own job system passes that instead.

Namespace
SmartTable::Dispatchers
Members
3

Public functions 3

TaskGraph
SMARTTABLES_API FSmartTableWorkDispatcher TaskGraph()

UE::Tasks::Launch, and nothing more. A model with no dispatcher runs its sort on the game thread, so this one reaches nothing until SetWorkDispatcher hands it over.

Synchronous
SMARTTABLES_API FSmartTableWorkDispatcher Synchronous()

Runs the work right there, on the calling thread.

The answer is in by the time the dispatch call comes back. Nothing moves off the game thread, so a sort over a large model holds the frame for as long as it takes.

RunOnGameThread
SMARTTABLES_API void RunOnGameThread( TUniqueFunction< void() > && Work )

Runs Work on the game thread, and right now when the caller is already on it.

Always going through a later frame would put every answer one tick behind, the ones a synchronous dispatcher worked out on the spot included. The check is what keeps those inside the same call.

Next: SmartTableColour.h