execute<Q> method
Null safety
- ComputeCallback0<
Q> callback, - Q params
执行线程
Implementation
int execute<Q>(ComputeCallback0<Q> callback, Q params) {
assert(!_shop, 'isolate executor has been closed!');
int id = ++_asyncId;
if (activeThread < maximumPoolSize) {
_addIsolate(
_IsolateConfiguration<Q>(id, callback, params),
activeThread < corePoolSize,
);
} else {
_isolateConfiguration.add(_IsolateConfiguration<Q>(
id,
callback,
params,
));
_notify();
}
return id;
}