private function fork()
    {
        /** @var LoggerInterface $logger */
        $logger = $this->getContainer()->get('logger');
        if (!$this->getContainer()->get('tenside.config')->isForkingAvailable()) {
            $logger->warning('Forking disabled by configuration, execution will block until the command has finished.');

            return false;
        } elseif (!FunctionAvailabilityCheck::isFunctionEnabled('pcntl_fork', 'pcntl')) {
            $logger->warning('pcntl_fork() is not available, execution will block until the command has finished.');

            return false;
        } else {
            $pid = pcntl_fork();
            if (-1 === $pid) {
                throw new \RuntimeException('pcntl_fork() returned -1.');
            } elseif (0 !== $pid) {
                // Tell the calling method to exit now.
                $logger->info('Forked process ' . posix_getpid() . ' to pid ' . $pid);
                return true;
            }

            $logger->info('Processing task in forked process with pid ' . posix_getpid());
            return false;
        }
    }