protected function launchSubProcess(): array
    {
        $systemCommand = 'FLOW_ROOTPATH=' . FLOW_PATH_ROOT . ' FLOW_PATH_TEMPORARY_BASE=' . FLOW_PATH_TEMPORARY_BASE . ' ' . 'FLOW_CONTEXT=' . $this->bootstrap->getContext() . ' ' . PHP_BINARY . ' -c ' . php_ini_loaded_file() . ' ' . FLOW_PATH_FLOW . 'Scripts/flow.php' . ' --start-slave';
        $descriptorSpecification = [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'a']];
        $subProcess = proc_open($systemCommand, $descriptorSpecification, $pipes);
        if (!is_resource($subProcess)) {
            throw new \RuntimeException('Could not execute sub process.');
        }

        $read = [$pipes[1]];
        $write = null;
        $except = null;
        $readTimeout = 30;

        stream_select($read, $write, $except, $readTimeout);

        $subProcessStatus = proc_get_status($subProcess);
        return ($subProcessStatus['running'] === true) ? [$subProcess, $pipes] : false;
    }