Compare commits

...

3 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 6392c92349 Cleaned up 2022-11-26 18:39:00 +02:00
Tristan B. Velloza Kildaire 28d64f799e Switch back to YIELD HoldOffMode for now (gives best performance)
We will have to investigate load average highness and ways to deal with it later
2022-11-26 18:19:21 +02:00
Tristan B. Velloza Kildaire cc75eefa15 Try 50ms 2022-11-26 18:16:07 +02:00
3 changed files with 22 additions and 13 deletions

View File

@ -184,9 +184,13 @@ public final class Engine : Thread
/* Yield if a lock fails (prevent potential thread starvation) */
defaultSettings.agressiveTryLock = false;
/* Make the event engine loop sleep (1) and for 200ms (2) (TODO: Adjust this) */
defaultSettings.holdOffMode = HoldOffMode.SLEEP;
defaultSettings.sleepTime = dur!("msecs")(200);
// FIXME: Investigate ways to lower load average
// /* Make the event engine loop sleep (1) and for 50ms (2) (TODO: Adjust this) */
// defaultSettings.holdOffMode = HoldOffMode.SLEEP;
// defaultSettings.sleepTime = dur!("msecs")(50);
/* Use yeilding for most responsiveness */
defaultSettings.holdOffMode = HoldOffMode.YIELD;
/* Do not gracefully shutdown */
defaultSettings.gracefulShutdown = false;

View File

@ -1,15 +1,13 @@
module eventy.event;
/**
* Event
*
* FIXME: Rename this to `Trigger`
*
* An Event represents a trigger for a given signal(s)
* handlers which associate with the given typeID
*
* It can optionally take a payload with it as well
*/
/**
* Event
*
* An Event represents a trigger for a given signal(s)
* handlers which associate with the given typeID
*
* It can optionally take a payload with it as well
*/
public class Event
{
/**
@ -24,4 +22,6 @@ public class Event
ulong id;
ubyte[] payload;
// TODO: Remove the requirement for the payload
}

View File

@ -1,5 +1,10 @@
module eventy.exceptions;
/**
* EventyException
*
* An Eventy runtime error
*/
public final class EventyException : Exception
{
this(string message)