AsyncResult<T> class
abstract
The AsyncResult is intended to simplify the implementation of handling asynchronous operations in synchronous methods by tracking state changes.
The AsyncResult is a result with 3 states:
- Pending
- Complete
- Complete with error
In combination with the ability to use null
as the initial value (result
processing has not been started), there are 4 states in total, which are
quite enough to implement rendering based on the use of asynchronous data.
Constructors
- AsyncResult.complete(T value)
-
factory
- AsyncResult.completeWithError(Object error, StackTrace stackTrace)
-
factory
- AsyncResult.create()
-
factory
Properties
- error → Object
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isComplete → bool
-
no setter
- ok → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace
-
no setter
- value → T
-
no setter
Methods
-
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