throttlePolling function
Throttle polling. @param throttleMilliseconds
- Amount in millisecond to wait between each polling.
Implementation
PollStrategy throttlePolling(int throttleMilliseconds) {
return (
Principal canisterId,
RequestId requestId,
RequestStatusResponseStatus status,
) async {
final c = Completer();
Future.delayed(Duration(milliseconds: throttleMilliseconds), c.complete);
return c.future;
};
}