CompletableIsolate<T> class
异步执行支持
Constructors
Properties
- error ↔ dynamic
-
错误信息
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isComplete ↔ bool
-
是否完成
getter/setter pair
- isError ↔ bool
-
是否发生了错误
getter/setter pair
- result ↔ T?
-
运行结果
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace ↔ StackTrace?
-
错误堆栈
getter/setter pair
Methods
-
cancel(
) → bool - 取消任务,无法取消正在执行中的任务
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCancel(
FutureOr< void> action()) → void - 取消事件
-
then<
R> (VoidCallback onValue, {Function? onError}) → void - 回调
-
toString(
) → String -
A string representation of this object.
inherited
-
wait(
) → Future< T> - 等待结果
-
whenComplete(
FutureOr< void> action()) → void - 无论是否完成,都发生回调事件
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
join<
T> (Iterable< CompletableIsolate< completableIsolate) → Future<T> >Iterable< CompletableIsolate< >T> > - 等待所有任务完成
-
runAsync<
Q, T> (ComputeCallback< Q, T> run, Q message, {IsolateExecutor? isolateExecutor, String debugLabel = 'CompletableIsolate'}) → CompletableIsolate<T> - 执行一个异步任务 该任务必须是一个全局方法或者静态方法