datetime/timebox_exception library

Timebox: run within time budget — roadmap #618.

Functions

timebox<T>(Future<T> fn(), Duration timeout, {T? onTimeout}) Future<T>
Runs fn; if not completed in timeout, returns onTimeout result (or throws).

Exceptions / Errors

TimeboxException
Thrown when timebox exceeds the allowed duration and no onTimeout was provided.