mirror of https://github.com/deavmi/tasky.git
Added Tasky Engine initialization (partly), initialize the Eventy engine, implemented Descriptor registration
This commit is contained in:
parent
826f110b17
commit
773a2eb77f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue