SyncFuture class

Helper class to call any Future with addition of timeout handling

Constructors

SyncFuture({required bool cancelOnDispose, required Duration? timeout, required Future<void> operation(), required FutureOr<void> onTimeout()?})

Properties

cancelOnDispose → bool
Flag indicating that this operation can be canceled
final
hashCode → int
The hash code for this object.
no setterinherited
isRunning ↔ bool
Flag indicating that this operation is still running
getter/setter pair
onTimeout → FutureOr<void> Function()?
Callback to process timeout exception
final
operation → Future<void> Function()
Actual Future function that must be executed by this class
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration?
Optional timeout for this operation
final

Methods

execute() → Future<void>
Executes operation and handles timeout exception
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited