mirror of https://github.com/deavmi/eventy.git
Engine
- Added an `Engine` which manages all promises and their tasks
This commit is contained in:
parent
9271fabfa9
commit
7d17b82c03
|
@ -0,0 +1,30 @@
|
|||
module eventy.engine;
|
||||
|
||||
import eventy.promise : Promise;
|
||||
import eventy.task : Task;
|
||||
|
||||
/**
|
||||
* Engine
|
||||
*
|
||||
* The core of the event sub-system, this maintains
|
||||
* promises, allows introspection and control over them
|
||||
* and also allows creating them
|
||||
*
|
||||
* NOTE: Do we even need this? Promises can track (themselves)
|
||||
* who is waiting for them
|
||||
*/
|
||||
public class Engine
|
||||
{
|
||||
|
||||
|
||||
public Promise create(Task task)
|
||||
{
|
||||
// Create a promise associated with this engine instance
|
||||
Promise newPromise = new Promise(this, task);
|
||||
|
||||
|
||||
return newPromise;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue