AsyncTimer

Constructors

this
this(EventLoop evl)

Members

Functions

duration
typeof(this) duration(Duration dur)

Sets or changes the duration on the timer. For a running timer, this setting will take effect after the timer is expired (oneShot) or after it is killed (periodic).

kill
bool kill()

Cleans up underlying OS resources. This is required to change the timer from periodic to oneshot, or before disposing of this object.

periodic
typeof(this) periodic(bool b = true)

Sets the timer to become periodic. For a running timer, this setting will take effect after the timer is expired (oneShot) or after it is killed (periodic).

rearm
bool rearm(Duration dur)

Runs a non-periodic, oneshot timer once using the specified Duration as a timeout. The handler from the last call to run() will be reused.

run
bool run(void delegate() del)

Starts the timer using the delegate as an expiration callback.

Properties

id
fd_t id [@property getter]
oneShot
bool oneShot [@property getter]

Returns whether the timer is set to rearm itself (oneShot=false) or if it will have to be rearmed (oneShot=true).

timeout
Duration timeout [@property getter]

Returns the Duration that the timer will wait before calling the handler after it is run.

Meta