protected function execute(InputInterface $input, OutputInterface $output)
{
$this->onStart();
$promise = Promise::doResolve($this->command($input, $output));
$promise->then(function ($value) {
return $this->onSuccess($value);
}, function ($ex) {
return $this->onFailure($ex);
}, function ($ex) {
return $this->onCancel($ex);
})->always(function () {
$this->onStop();
});
}