public static function runImmediateTask($taskId)
    {
        $command = new ProcessBuilder();
        $command->setWorkingDirectory(Yii::getAlias('@app'));
        $command->setPrefix(self::getPhpBinary());
        if (strncasecmp(PHP_OS, 'WIN', 3) === 0) {
            $command->add('yii');
        } else {
            $command->add('./yii');
        }
        $command->add('deferred/index')->add("$taskId");
        $process = $command->getProcess();
        $process->setWorkingDirectory(Yii::getAlias('@app'));
        $process->disableOutput();
        if (strncasecmp(PHP_OS, 'WIN', 3) === 0) {
            $process->setCommandLine('start /b "deferred" ' . $process->getCommandLine());
        } else {
            $process->setCommandLine($process->getCommandLine() . ' &');
        }
        if (isset(Yii::$app->params['deferred.env'])) {
            $process->setEnv(ArrayHelper::merge(Yii::$app->params['deferred.env'], $process->getEnv()));
        }
        $process->mustRun();
    }