Function Nominator.setupTimer

Used for setting and clearing C++ callbacks which fire after a given timeout.

override extern(C++) void setupTimer (
  ulong slot_idx,
  int timer_type,
  duration!(long,scpd.Cpp.ratio!(1,1000).ratio) timeout,
  CPPDelegate!(extern(C++)voidfunction()*)* callback
);

On the D side we spawn a new task which waits until a timer expires.

The callback is a C++ delegate, we use a helper function to invoke it.

Parameters

NameDescription
slot_idx the slot index we're currently reaching consensus for.
timer_type the timer type (see Slot.timerIDs).
timeout the timeout of the timer, in milliseconds.
callback the C++ callback to call.