initialize method

void initialize()

Calls performInitialization with extra bookkeeping. Descendant classes should implement performInitialization but then invoke initialize.

Implementation

void initialize() {
  if (_hasCalledInitialize) {
    _log.warning(
      'Re-initializing readiness for $this. This is a no-op, but did you '
      'potentially await `ready` first, which calls `initialize` if you '
      'did not?',
    );
    return;
  }

  _log.finest('Initializing readiness for $this');
  _hasCalledInitialize = true;
  final initializationResult = performInitialization();
  if (initializationResult is Future<T>) {
    unawaited(initializationResult);
  }
}