stop method

void stop()

Stop the scheduler.

Implementation

void stop() {
  _stopped = true;
  _enablePoll?.cancel();
  _enablePoll = null;
  _checkTimer?.cancel();
  _checkTimer = null;
  _lockProbeTimer?.cancel();
  _lockProbeTimer = null;
  _watcher?.cancel();
  _watcher = null;
  if (_isOwner) {
    _isOwner = false;
    releaseSchedulerLock(
      opts: _options.dir != null || _options.lockIdentity != null
          ? SchedulerLockOptions(
              dir: _options.dir,
              lockIdentity: _options.lockIdentity,
            )
          : null,
      sessionId: _options.lockIdentity,
    );
  }
}