eve.rt.timer
Runtime Layer Timer Primitives
This module provides high-level asynchronous timer primitives built on top of the EVE event loop. Unlike the low-level eve.core.timer which defines timer specifications, this module provides ready-to-use async timer operations for use with fibers and futures.
Copyright
Types 4
State of an async timer operation.
High-level asynchronous timer for use with the runtime layer.
An AsyncTimer wraps the low-level timer machinery and provides a higher-level interface suitable for use with fibers and futures. It supports one-shot delays, repeating intervals, and cancellation.
AsyncTimer oneShot(long delayMs) pure @safe nothrow @nogcCreates a one-shot timer that fires after the specified delay.AsyncTimer repeating(long intervalMs, long initialDelayMs = - 1) pure @safe nothrow @nogcCreates a repeating timer with the specified interval.TimerSpec spec() @property const pure @safe nothrow @nogcReturns the underlying timer specification.ulong fireCount() @property const pure @safe nothrow @nogcReturns the number of times this timer has fired.bool isRepeating() @property const pure @safe nothrow @nogcReports whether this timer repeats after firing.bool isRunning() @property const pure @safe nothrow @nogcReports whether the timer is currently running.this(long delayMs, long intervalMs = 0)Constructs an async timer with the specified delay and interval.Configuration for timeout operations.
A Timeout wraps a duration and can be used to limit the time spent waiting for an operation to complete.
long durationMsThe timeout duration in milliseconds.bool expiredIndicates whether the timeout has been exceeded.bool isImmediate() @property const pure @safe nothrow @nogcReports whether the timeout duration is zero or negative.this(long ms)Constructs a timeout with the specified duration.Represents a sleep duration for suspending execution.
A Sleep is a high-level primitive for pausing fiber execution for a specified duration. Unlike AsyncTimer, a sleep is always a one-shot operation.
private long durationMs_private bool completed_long durationMs() @property const pure @safe nothrow @nogcReturns the sleep duration in milliseconds.this(long ms)Constructs a sleep with the specified duration.