From 05718602b307a4649549592906dc1c0ff8f1f613 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Mon, 22 Jun 2020 20:16:39 +0200 Subject: [PATCH] Added event loop. --- source/tristanable/manager.d | 5 +++++ source/tristanable/watcher.d | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/source/tristanable/manager.d b/source/tristanable/manager.d index 62b7ee2..44cfc89 100644 --- a/source/tristanable/manager.d +++ b/source/tristanable/manager.d @@ -18,5 +18,10 @@ public final class Manager { /* TODO: Create the watcher */ watcher = new Watcher(this, endpoint); + + /* TODO: Other initializations (queues etc.) */ + + /* Start the watcher */ + watcher.start(); } } \ No newline at end of file diff --git a/source/tristanable/watcher.d b/source/tristanable/watcher.d index 2a67720..ebdd5e4 100644 --- a/source/tristanable/watcher.d +++ b/source/tristanable/watcher.d @@ -22,7 +22,16 @@ public final class Watcher : Thread this(Manager manager, Socket endpoint) { + super(&watchLoop); this.manager = manager; this.endpoint = endpoint; } + + private void watchLoop() + { + while(true) + { + /* TODO: Loop here */ + } + } } \ No newline at end of file