start method

Future<bool> start()

Starts this executor. Any call to execute will call start if this is not started yet.

Implementation

Future<bool> start() async {
  if (_started) return true;

  if (_starting != null) {
    return _starting!.future;
  }

  var starting = _starting = Completer<bool>();

  _logger.logInfo('Starting $this');

  _executorThread.start().then((_) {
    _started = true;
    starting.complete(true);
    _flushTasksToExecute();
    _starting = null;
  });

  return starting.future;
}