Kraken\Runtime\Supervision\Runtime\RuntimeRecreate::solver PHP Method

solver() protected method

protected solver ( Erro\Error | Exceptio\Exception $ex, mixed[] $params = [] ) : mixed
$ex Erro\Error | Exceptio\Exception
$params mixed[]
return mixed
    protected function solver($ex, $params = [])
    {
        $manager = $this->runtime->getManager();
        $hash = isset($params['hash']) ? $params['hash'] : '';
        $alias = $params['origin'];
        if ($manager->existsThread($alias)) {
            return $manager->createThread($alias, null, Runtime::CREATE_FORCE, ['hash' => $hash]);
        } else {
            if ($manager->existsProcess($alias)) {
                return $manager->createProcess($alias, null, Runtime::CREATE_FORCE, ['hash' => $hash]);
            }
        }
        return Promise::doReject(new RejectionException("Runtime [{$alias}] does not exists."));
    }
RuntimeRecreate