TAwaitable.addCallback

Registers a callback that is called if the event occurs.

The delegate will likely be invoked from a different thread, and is expected not to perform expensive work as it will usually be invoked synchronously by the notifying thread. The order in which registered callbacks are invoked is not specified.

The callback must never throw, but nothrow semantics are difficult to enforce, so currently exceptions are just swallowed by TAwaitable implementations.

If the event has already occurred, the delegate is immediately executed in the current thread.

interface TAwaitable
void
addCallback
(
void delegate
()
dg
)

Meta