Skip to content

Picking an ActionEngine implementation

Elliot Ford edited this page Apr 14, 2015 · 6 revisions

What is an ActionEngine?

An ActionEngine is used to schedule and execute Actions. It does this by providing an ActionContext bound to that Action and the engine itself (see Scheduling, awaiting and cancelling actions for more information).

The default ActionEngine

Java 8 offers a common ForkJoinPool (see API docs) that be can used as the default pool for ForkJoinTasks. With this available JALSE provides a wrapper for this pool using ForkJoinActionEngine: ForkJoinActionengine.commonPoolEngine(). The default EntityFactory and JALSEBuilder use this common engine instance.

ForkJoinActionEngine (see [API docs]) is built upon ForkJoinPool and it does this using ForkJoinPool.managedBlock(ForkJoinPool.ManagedBlocker). ForkJoinActionEngine uses a blocking task that will wake up when the schedule execution time arrives (only active when there is waiting work).

Creating a custom ActionEngine implementation

Clone this wiki locally