DHUFutureExtensions<T> extension

Extensions for Future to add functionality like timeouts and minimum waits.

on

Methods

minWait(Duration duration) Future<T>

Available on Future<T>, provided by the DHUFutureExtensions extension

Ensures the future takes at least duration to complete.
timeoutOrNull(Duration timeout) Future<T?>

Available on Future<T>, provided by the DHUFutureExtensions extension

Returns the result of the future if it completes within timeout, otherwise returns null.