WIP: GOtta figure out timing and maybe hot loops and shit

This commit is contained in:
Tristan B. Velloza Kildaire 2022-03-19 12:57:59 +02:00
parent 295d9ff672
commit 915b0ad115
1 changed files with 15 additions and 1 deletions

View File

@ -41,6 +41,8 @@ public final class Engine : Thread
tmanager = new Manager(socket);
start();
writeln("Task enegine finished init");
}
public class TaskyEvent : Event
@ -63,6 +65,8 @@ public final class Engine : Thread
*/
private void worker()
{
ulong got = 0;
while(true)
{
//writeln("WHITE BOY SUMMER");
@ -70,6 +74,9 @@ public final class Engine : Thread
/* TODO: Get all tristanable queues */
Queue[] tQueues = tmanager.getQueues();
// writeln("Got: ", got);
foreach(Queue tQueue; tQueues)
{
// writeln("Check queue: ", tQueue);
@ -95,9 +102,10 @@ public final class Engine : Thread
// evEngine.push
writeln("Queue just dequeued from: ", descID, " ", tQueue);
got++;
}
@ -106,6 +114,8 @@ public final class Engine : Thread
/* TODO: Per each queue */
/* TODO: Yield away somehow */
import core.thread : dur;
sleep(dur!("msecs")(500));
}
}
@ -198,6 +208,8 @@ public final class Engine : Thread
sleep(dur!("seconds")(2));
writeln("Server sending!!!!!!!!!!!");
import tristanable.encoding : DataMessage, encodeForSend;
DataMessage dMesg = new DataMessage(jobTypeDI, cast(byte[])"Hello 1");
writeln("Server send 1: ", clientSocket.send(encodeForSend(dMesg)));
@ -231,6 +243,8 @@ public final class Engine : Thread
e.registerDescriptor(jobType);
e.registerDescriptor(jobType2);
writeln("TAsk client tests finished registration");
while(true)
{