trigger method

Future<ReproviderResult> trigger({
  1. bool wait = false,
})

Manually triggers a reprovide run.

If wait is true and another run is already in progress, the call waits for that run to finish before starting a new one. Otherwise, a busy result is returned immediately.

Implementation

Future<ReproviderResult> trigger({bool wait = false}) async {
  _logger.debug('Manual reprovide triggered (wait=$wait)');

  final pendingRun = _currentRun;
  if (pendingRun != null) {
    if (wait) {
      _logger.debug('Waiting for in-flight reprovide run to complete');
      await pendingRun;
    } else {
      return _busyResult();
    }
  }

  return _runLock.synchronized(_run);
}