function cancelMain() {
    if (mainTask.status === RUNNING) {
      mainTask.status = CANCELLED
      next(TASK_CANCEL)
    }
  }
cancellation of the main task. We'll simply resume the Generator with a TASK_CANCEL