stop method

  1. @override
void stop(
  1. [Function? callBack]
)

stop and remove all remain jobs in queue

would be useful if want to stop the queue when a job fails callBack is where use can call cancelToken or side effect

Implementation

@override
void stop([Function? callBack]) {
  if (callBack != null) callBack();
  _isForcedStop = true;
  _isRunning = false;
  _first = null;
  _last = null;
  _size = 0;
  _map.clear();
  _previousResult = null;
  _isForcedStop = false;
  _emitEvent(QueueEventType.queueStopped);
}