Kraken\Runtime\Container\Manager\ThreadManagerBase::destroyThreads PHP Method

destroyThreads() public method

public destroyThreads ( $aliases, $flags = Runtime::DESTROY_FORCE_SOFT, $params = [] )
    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.');
        });
    }