diff --git a/source/eventy/engine.d b/source/eventy/engine.d index a1f0443..c348173 100644 --- a/source/eventy/engine.d +++ b/source/eventy/engine.d @@ -95,6 +95,8 @@ public final class Engine : Thread private Duration sleepTime; + private bool running; + this() { super(&run); @@ -144,7 +146,9 @@ public final class Engine : Thread */ public void run() { - while(true) + running = true; + + while(running) { /* TODO: Implement me */ @@ -198,6 +202,16 @@ public final class Engine : Thread } } + /** + * Stops the event engine + * + * TODO: Examine edge cases where this might not work + */ + public void shutdown() + { + running = false; + } + /** * Dispatch(Signal[] set, Event e) *