From bc80c4aec56c6f857ca4b0eaea36f507c1ff7288 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 9 Sep 2021 11:23:59 +0200 Subject: [PATCH] WIP: Poll each task's tristanable queue and then dequeue if ready --- source/app.d | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/app.d b/source/app.d index f312c04..e2cfc28 100644 --- a/source/app.d +++ b/source/app.d @@ -152,7 +152,25 @@ public final class TaskManager : Thread private void worker() { + while(true) + { + currentTasksLock.lock(); + foreach(Task task; currentTasks) + { + /* Find the matching tristananble queue */ + TQueue tQueue = manager.getQueue(task.getID()); + + /* TODO: Poll queue here */ + if(tQueue.poll()) + { + /* Dequeue the item */ + QueueItem tQueueItem = tQueue.dequeue(); + } + } + + currentTasksLock.unlock(); + } } /**