protected function command($params = [])
{
$runtime = $this->runtime;
$channel = $this->channel;
$promise = $this->runtime->start();
return $promise->then(function () use($runtime) {
return $runtime->getManager()->getRuntimes();
})->then(function ($children) use($channel) {
$promises = [];
foreach ($children as $childAlias) {
$req = $this->createRequest($channel, $childAlias, new RuntimeCommand('arch:start'));
$promises[] = $req->call();
}
return Promise::all($promises);
})->then(function () {
return 'Part of architecture has been started.';
}, function () {
throw new RejectionException('Part of architecture could not be started.');
});
}