public function destroyThreads($aliases, $flags = Runtime::DESTROY_FORCE_SOFT, $params = [])
{
$promises = [];
foreach ($aliases as $alias) {
$promises[] = $this->destroyThread($alias, $flags, $params);
}
return Promise::all($promises)->then(function () {
return 'Threads have been destroyed.';
}, function () {
throw new RejectionException('Some of the threads could not be destroyed.');
});
}