Added Tasky Engine initialization (partly), initialize the Eventy engine, implemented Descriptor registration

This commit is contained in:
Tristan B. Velloza Kildaire 2022-01-16 18:12:10 +02:00
parent 826f110b17
commit 773a2eb77f
1 changed files with 20 additions and 0 deletions

View File

@ -7,9 +7,29 @@
*/
module tasky.engine;
import eventy.engine : EvEngine = Engine;
import tasky.jobs : Descriptor;
public final class Engine
{
private EvEngine evEngine;
this()
{
/* Create a new event engine */
evEngine = new EvEngine();
evEngine.start();
}
/**
* Register a Descriptor with tasky
*/
public void registerDescriptor(Descriptor desc)
{
/* Add a queue based on the descriptor ID */
evEngine.addQueue(desc.getDescriptorClass());
/* Add a signal handler that handles said descriptor ID */
evEngine.addSignalHandler(desc);
}
}