complete method

void complete(
  1. String taskId,
  2. int code
)

Implementation

void complete(String taskId, int code) {
  final pending = _tasks[taskId];

  if (pending == null) {
    logger.err('Pending task $taskId not found');
    return;
  }

  pending.task.code = code;

  if (code != 0) {
    killAll();
  }
}