The amount of time to wait before starting to execute the work delegate.
The code to execute after the specified amount of time has passed.
// A very basic example – usually, the actuall work item would enqueue // some async transport operation. auto asyncMangager = someAsyncManager(); TFuture!int calculate() { // Create a promise and asynchronously set its value after three // seconds have passed. auto promise = new TPromise!int; asyncManager.delay(dur!"seconds"(3), { promise.succeed(42); }); // Immediately return it to the caller. return promise; } // This will wait until the result is available and then print it. writeln(calculate().waitGet());
Submits a delegate to be executed after a certain amount of time has passed.
The actual amount of time elapsed can be higher if the async manager instance is busy and thus should not be relied on. The