Function ICoreEventLoop.addDelegateOnLoopIteration

Adds a delegate to be called on each loop iteration, called based on the timingFlags.

abstract void addDelegateOnLoopIteration(
  void delegate() dg,
  uint timingFlags
);

The order in which the delegates are called is undefined and may change with each iteration of the loop. Additionally, when and how many times a loop iterates is undefined; multiple events might be handled by each iteration, or sometimes, nothing will be handled and it woke up spuriously. Your delegates need to be ok with all of this.

Parameters

dg = the delegate to call timingFlags = 0: never actually run the function; it can assert error if you pass this 1: run before each loop OS wait call 2: run after each loop OS wait call 3: run both before and after each OS wait call 4: single shot? NOT IMPLEMENTED 8: no-coalesce? NOT IMPLEMENTED (if after was just run, it will skip the before loops unless this flag is set)

FIXME

it should return a handle you can use to unregister it