vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function EventDriverTimers.wait

Waits for the timer to fire.

final abstract void wait (
  TimerID timer,
  nothrow @safe void delegate(TimerID) callback
) nothrow @safe;

abstract void wait (
  TimerID timer,
  nothrow @safe void delegate(TimerID, bool) callback
) nothrow @safe;

Important

the callback of the timer will be called exactly once, unless cancelWait gets called first. wait needs to be called again to receive future timer events (see https://github.com/vibe-d/eventcore/issues/172 for reasons behind that behavior).

Note that the TimerCallback based overload will not call the callback if stop gets called before the timer fires, whereas the TimerCallback2 based overload will call the callback with the fired parameter set to false.

Authors
Copyright
License