CompletableIsolate<T> class Null safety

异步执行支持

Constructors

CompletableIsolate()

Properties

error ↔ dynamic
错误信息
read / write
hashCode int
The hash code for this object.
read-onlyinherited
isComplete bool
是否完成
read / write
isError bool
是否发生了错误
read / write
result ↔ T?
运行结果
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
stackTrace StackTrace?
错误堆栈
read / write

Methods

cancel() bool
取消任务,无法取消正在执行中的任务
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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>(List<CompletableIsolate<T>> completableIsolate) Future<List<CompletableIsolate<T>>>
等待所有任务完成
runAsync<Q, T>(ComputeCallback<Q, T> run, Q message, {IsolateExecutor? isolateExecutor, String debugLabel = 'CompletableIsolate'}) CompletableIsolate<T>
执行一个异步任务 该任务必须是一个全局方法或者静态方法