complete method
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();
}
}