ScheduledDelegate

A delegate paired with a long UNIX timestamp.

If we bundle the two together like this, we can associate a point in time with a delegate without having to to use an associative array (with UNIX timestamp keys).

Constructors

this
this(void delegate() dg, long timestamp, string creator)

Constructor.

Members

Variables

creator
string creator;

String name of the function that created this ScheduledDelegate.

dg
void delegate() dg;

Delegate to trigger at the point in time timestamp.

timestamp
long timestamp;

When dg is scheduled to be called, in hnsecs from midnight Jan 1st 1970.

Examples

import std.datetime.systime : Clock;

void dg() { /* ... */ }

auto scheduledDg = ScheduledDelegate(&dg, Clock.currTime.stdTime + 10 * 10_000_000);