execute<Q> method

int execute<Q>(
  1. ComputeCallback0<Q> callback,
  2. 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;
}