throttle function

PollStrategy throttle(
  1. int throttleInMsec
)

Throttle polling. @param throttleInMsec Amount in millisecond to wait between each polling.

Implementation

PollStrategy throttle(int throttleInMsec) {
  return (Principal canisterId, RequestId requestId, String status) async {
    var c = Completer();
    Future.delayed(Duration(milliseconds: throttleInMsec), c.complete);
    return c.future;
  };
}