resume method
Resumes a paused task from the bytes already written. Returns false when the task is not paused (or pausing).
Implementation
bool resume() {
switch (_phase) {
case _Phase.paused:
_phase = _Phase.running;
_waitBeforeNextStep = false;
// Time spent paused is not time spent failing.
_failingSince = null;
_retryWait = Duration.zero;
_emit();
unawaited(_run());
return true;
case _Phase.pausing:
_phase = _Phase.running;
return true;
case _Phase.running ||
_Phase.canceling ||
_Phase.success ||
_Phase.canceled ||
_Phase.error:
return false;
}
}