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

createThreads() public method

public createThreads ( $definitions, $flags = Runtime::CREATE_DEFAULT, $params = [] )
    public function createThreads($definitions, $flags = Runtime::CREATE_DEFAULT, $params = [])
    {
        $promises = [];
        foreach ($definitions as $alias => $name) {
            $promises[] = $this->createThread($alias, $name, $flags, $params);
        }
        return Promise::all($promises)->then(function () {
            return 'Threads have been created.';
        }, function () {
            throw new RejectionException('Some of the threads could not be created.');
        });
    }