Conditions upon which timers decide whether they are to fire yet, or wait still.
Yields a random line from the lines array.
What message/time conditions this Timer abides by.
Workhorse Fiber.
The channel message count at last successful trigger.
The timestamp at the last successful trigger.
The timered lines to send to the channel.
Delay in number of messages before the timer initially comes into effect.
How many messages must have been sent since the last announce before we will allow another one.
String name identifier of this timer.
The current position, kept to keep track of what line should be yielded next in the case of ordered timers.
Whether or not this Timer is suspended and should not output anything.
Delay in seconds before the timer initially comes into effect.
How many seconds must have passed since the last announce before we will allow another one.
What type of Timer this is.
Timer timer; timer.lines = [ "abc", "def", "ghi" ]; { timer.type = Timer.TimerType.ordered; assert(timer.getLine() == "abc"); assert(timer.getLine() == "def"); assert(timer.getLine() == "ghi"); assert(timer.getLine() == "abc"); assert(timer.getLine() == "def"); assert(timer.getLine() == "ghi"); } { import std.algorithm.comparison : among; timer.type = Timer.TimerType.random; bool[string] linesSeen; foreach (immutable i; 0..300) { linesSeen[timer.getLine()] = true; } assert("abc" in linesSeen); assert("def" in linesSeen); assert("ghi" in linesSeen); }
Definitions of a timer.