pause method

bool pause()

Pauses a running task: the connection is closed, the bytes written so far stay. Returns false when the task is not running. After true, the paused event follows on progress unless the task ends first.

Implementation

bool pause() {
  if (_phase != _Phase.running) {
    return false;
  }
  _phase = _Phase.pausing;
  _abortInFlight();
  return true;
}